PointA is not acquiring the Semaphore - if you set the permit value to 1, and have the PointA class acquire the Semaphore prior to PointB, then PointB can only acquire the Semaphore after PointA...
Type: Posts; User: copeg
PointA is not acquiring the Semaphore - if you set the permit value to 1, and have the PointA class acquire the Semaphore prior to PointB, then PointB can only acquire the Semaphore after PointA...
Sorry, didn't initially see you were using the Semaphore class. This class facilitates acquiring locks to a certain number of threads. In your case you could create a Semaphore of size 1, and pass...
You can use the Semaphore in a wait/notify context...for instance, Thread B calls wait...once thread A completes it calls notify on the semaphore.