haXe API Documentation
Back | Index
class sys.mt.Lock
Available in neko, php, cpp
A multithread lock.
function new() : Void
Creates a new lock, which is initially acquired.
function release() : Void
Release the lock, even if you don't own it. If a lock is released several times, it can then be acquired as many times.
function wait(?timeout : Float) : Bool
Wait until the lock is available, and acquire it. You can specify a timeout (in seconds), it which case the returned value will indicate if the lock has been successfully acquired in the elapsed time. No timeout or a negative value means an infinite wait.
Back | Index