trylock


Description:

public abstract bool trylock ()

Tries to lock this.

If it is already locked by another thread, then it immediately returns FALSE, otherwise it locks this.

Note: unlike @lock, this method recursive, which means a thread can lock this several times (and has to unlock it as many times to actually unlock it).

Parameters:

this

a Lockable object.

Returns:

TRUE if the object has successfully been locked.