Search:

Type: Posts; User: copeg

Search: Search took 0.22 seconds.

  1. Replies
    5
    Views
    2,409

    Re: Help with Synchronisation with a semaphore

    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...
  2. Replies
    5
    Views
    2,409

    Re: Help with Synchronisation with a semaphore

    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...
  3. Replies
    5
    Views
    2,409

    Re: Help with Synchronisation with a semaphore

    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.
Results 1 to 3 of 3