Possible deadlock solution


I believe that the deadlock problem can be solved by adding a bounded time to the circular wait.  I think by doing so you eliminate the hold and wait criteria needed for a deadlock therefore deadlock is prevented.  Picture a 4-way traffic stop where all lights are red and a timer goes on to enable pedestrians to walk in all directions.  This illustrates the circular wait and without the timer, there is a deadlock.  Coding this is the way I figure it just adding a time constraint condition to the while loop which is a circular or busy wait.