Here is my current implementation of a semaphore using a function and shared memory.
Line to use with FUNCTION:
semaphore=%@TRIM[%@execstr[0,SETLOCAL & SET Hndl=%@SMOPEN[8,Semaphore%1] & SET OHndl=%@SMPEEK[%Hndl,4,4] & IFF %OHndl == 0 THEN & SET RtnH=%@SMPOKE[%Hndl,4,4,%Hndl] & DELAY /M 2 &...