trylock


Description:

public bool trylock ()

Tries to lock this.

If this is already locked by another thread, it immediately returns false. Otherwise it locks this and returns true.

Mutex is neither guaranteed to be recursive nor to be non-recursive. As such, calling @lock on a Mutex that has already been locked by the same thread results in undefined behaviour (including but not limited to deadlocks or arbitrary return values).

Parameters:

this

a Mutex

Returns:

true if this could be locked