img
. . . . .
recursive lock). If the lock is held by a different thread, this thread will go to sleep waiting for it to
become available.
Reference:
Chapter 6.
wait
public void wait()
throws InterruptedException
This causes the current thread to block until it is awakened by either a call to notify(),
interruption, or by a spurious wakeup. It will release the synchronization lock for the object as it
goes to sleep and reacquire it before returning.
Chapter 6.
Reference:
notify notifyAll
public void notify()
public void notifyAll()
These cause (one/all) of the threads that are in a wait() call for this object to wake up and return.
Reference:
Chapter 6.
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.
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home