Mutex

Mutex

package java-vm

Available on java

Constructor

new ()

Creates a mutex, which can be used to acquire a temporary lock to access some resource. The main difference with a lock is that a mutex must always be released by the owner thread

Methods

acquire ():Void

The current thread acquire the mutex or wait if not available. The same thread can acquire several times the same mutex, but must release it as many times it has been acquired.

release ():Void

Release a mutex that has been acquired by the current thread. If the current thread does not own the mutex, an exception will be thrown

tryAcquire ():Bool

Try to acquire the mutex, returns true if acquire or false if it's already locked by another thread.

© 2005–2016 Haxe Foundation
Licensed under a MIT license.
http://api.haxe.org/java/vm/Mutex.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部