[concurrency-interest] Lock & semaphore

Kasper Nielsen kav@it.edu
Thu, 11 Sep 2003 13:48:21 +0200


Hi,

Looking at the Semaphore and the Lock interface they both have almost
the same methods (with different names though).

--------Lock---------
void lock                  -
void lockInterruptibly     - interrupted
bool trylock (timeunit)    - interrupted
bool trylock         

--------Semaphore-----
FairSemaphore
void acquire               - interrupted
void acquireUninterruptibly 
bool tryacquire (timeunit) - interrupted
bool tryacquire   

I think it would be more consistent if _both_ lock and acquire either
threw an interrupted exception or didn't.

- Kasper