[RFC] "lock" statement and "mutex" type.
Dejan Lekic
dejan at nu6.org
Tue Mar 14 15:28:16 PST 2006
Hi Sean,
yes, i did not think about acquisition with a timeout maybe following syntax
change is what we would like to have:
lock (<mutex variable>[, timeout])
You understood everything else. My was plain simple trylock. Following code
is an example of code without try:
lock (myMutex) // blocks calling thread
{
doSomething();
}
as we slightly changed the main idea (from my previous post), we could have
something like:
lock (myMutex, 1000) // blocks calling thread for 1 second
{ // if mutex "myMutex" is not unlocked during that time
doSomething(); // it will exit the lock() block and execute continue()
} // function.
continue();
Regards
-----------
Dejan Lekic
http://dejan.lekic.org
More information about the Digitalmars-d
mailing list