SEMAPHORES - luxembourg/muxcode-clm GitHub Wiki

SEMAPHORES (continued)

You may also combine the semaphore and timer options of @wait with '@wait <object>/<timeout> = <command>' If the time period expires before the semaphore is notified, then the command is executed and the semaphore count is decremented, just as if the command had been run because the semaphore had been notified.

Examples: <simple> @wait semaphore="Foo @notify semaphore <mutex lock> @va mutex lock=@wait me=@trig me/vb @vb mutex lock="Got it!;@notify me @startup mutex lock=@notify me <timed wait> @wait timer/60 = "Sixty Second Timer.

In the above examples you will say "Foo" after semaphore is notified, you will say "Got it" when you have the mutual exclusion lock mutex lock (You could have also modified object registers that need to be protected from concurrent update), and you will say "Sixty Second Timer." either when timer is notified or after sixty seconds pass.

Related Topics: @drain, @notify, @wait

⚠️ **GitHub.com Fallback** ⚠️