The synchronisation between releasing internal agentj threads and the awaiting threads continuation has been a problem for Agentj. This class is an implementation of a syn that ateempts to solve this issue, which is: when a thread releases a waiting thread, the release method returns before the waiting one, which cause a gap in which the thread counter decrements and releases a node before the waiting thread has processed. Previous attempts at solving this including timing delays and incrementing thread counter just before a release and then decrementing again once the waiting thread continues. Both schemes are hard to debug. Here, we synchronise internally so that the waiting thread always returns before the releasing one. This class also implements lists for multiple sends before releasing and synchronisation so that "puts" before "waits" work too.
Created by scmijt Date: Oct 21, 2008 Time: 7:16:26 PM