SQLJet Home

org.tmatesoft.sqljet.core
Interface ISqlJetMutex


public interface ISqlJetMutex

Mutex interface. SQLJet may have different implementations of mutexes.

Author:
TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)

Method Summary
 boolean attempt()
          Locks mutex if it is unlocked and return true.
 void enter()
          Locks mutex.
 boolean held()
          Check mutex locking status.
 void leave()
          Unlocks mutex.
 

Method Detail

enter

void enter()
Locks mutex. If mutex is locked then this method waits while it will unlock.


attempt

boolean attempt()
Locks mutex if it is unlocked and return true. Otherwise just return false. This method doesn't wait.

Returns:
true if this method locked mutex or false if mutex was already locked by other thread.

leave

void leave()
Unlocks mutex.


held

boolean held()
Check mutex locking status.

Returns:
true if mutex is locked or false if mutex is unlocked.

SQLJet Home

Copyright © 2009-2010 TMate Software Ltd. All Rights Reserved.