common-util

local.tomas.util.sync
Interface SyncInterface

All Known Implementing Classes:
Mutex, Semaphore

public interface SyncInterface

Title: Generic synchronization interface Description: Copyright: Copyright (c) 2001 Company: Tomas Teubner

Version:
1.0
Author:
Tomas Teubner

Method Summary
 void lock()
          Lock object.
 boolean trylock()
          Try to lock object.
 void unlock()
          Unlock object.
 

Method Detail

lock

void lock()
          throws InterruptedException
Lock object. Calls to this method will block until object can be locked.

Throws:
InterruptedException

unlock

void unlock()
Unlock object.


trylock

boolean trylock()
                throws InterruptedException
Try to lock object. Calls to this method return immediately. Lock is performed if possible, otherwise false is returned.

Returns:
true if lock succeeded, false otherwise
Throws:
InterruptedException

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.