Was working on some routines that need wait instructions and would have several copies of it running at the same time.. tried using a pointer to an local variable but found that didn't work... So I wrote this routines to handle to bi-directional semaphores. There is an example of use at the bottom that is also the unit test code. Enjoy.