class neko.vm.MutexAvailable in nekoA mutex can be used to allow only one thread at a time to execute a block of code. Usually that code operates on shared data. function new() : Void function acquire() : VoidThe calling thread locks the mutex. If another thread has already locked the mutex, the calling thread will block until it is released. A thread can acquire a mutex it already has, but will have to release it twice as well. function release() : VoidThe calling thread releases its lock on the mutex, allowing another thread to acquire it. If there are multiple threads blocking, only one will acquire the lock; the others will continue blocking. This function must be called from the thread that holds the lock on the mutex. function tryAcquire() : BoolIf the mutex is not locked, the calling thread locks it and returns true. If the mutex is locked, the calling thread returns false immediately.
version #7450, modified 2010-01-06 04:22:50 by Yarias
0 comment