img
. . . . .
This causes the current thread to set a flag indicating that it is interruptible. The method
interrupt() will look at this. If the flag indicates a pending interrupt, that interrupt will be
reissued at this time.
Chapter 9.
Reference:
The Class Extensions.Semaphore
This is one of our classes. It implements POSIX-style semaphores. It is probably not useful except
for demo programs.
semWait
public void semWait()
This attempts to decrement the value of the semaphore. If it succeeds, it simply returns. If the
value is zero, this will cause the current thread to go to sleep until another thread increments it.
Reference:
Chapter 6.
semPost
public void semPost()
This increments the value of the semaphore, waking up one thread (if any are sleeping).
Reference:
Chapter 6.
The Class Extensions.Mutex
This is one of our classes. It implements POSIX-style (non-recursive) mutex locks. Use only when
synchronized sections won't work, such as chained locking.
lock
public void lock()
This locks the mutex. If the lock is held by a different thread, this thread will go to sleep, waiting
for it to become available.
Reference:
Chapter 6.
unlock
public void unlock()
This unlocks the mutex, waking up one thread (if any are sleeping).
Reference:
Chapter 6.
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home