Interface LockableStream

All Known Implementing Classes:
DatastoreRandomAccessStream, DatastoreReadStream, DatastoreWriteStream, FileInput, FileInputOutput, FileOutput, FileRandomAccessStream, FileReadStream, FileWriteStream, HttpInputOutput, JniFileStream, JniMemoryMappedFile, JniRandomAccessFile, NullWriteStream, RandomAccessStream, ReadStream, SpyRandomAccessStream, WriteStream

public interface LockableStream

Method Summary
 boolean lock(boolean shared, boolean block)
          Lock the shared advisory lock.
 boolean unlock()
          Unlock the advisory lock.

Method Detail


boolean lock(boolean shared,
             boolean block)
Lock the shared advisory lock. This method will create a shared "read" lock when the shared argument is true and an exclusive "write" lock when the shared argument is false. If the block argument is false then this call will not block if the lock can't be obtained.


boolean unlock()
Unlock the advisory lock. Return true if a lock was held, false otherwise.