Archive of UserLand's first discussion group, started October 5, 1998.
Re: Check status of a semaphore without trying to change it?
Author: Brent Simmons Posted: 8/24/1999; 12:01:34 PM Topic: Check status of a semaphore without trying to change it? Msg #: 9820 (In response to 9819) Prev/Next: 9819 / 9821
Here's another way:
Try to lock the semaphore with a short timeout of 1 tick. If it fails, it's locked already. If it succeeds, it wasn't locked. (You may then want to unlock it, depending on what you want to do.)
This changes the value -- but for very little time.
This page was archived on 6/13/2001; 4:52:03 PM.
© Copyright 1998-2001 UserLand Software, Inc.