Mutexes and locking
alexhairyman
alexhairyman at gmail.com
Sun Mar 2 22:38:42 PST 2014
I think I'm missing something big, but I'm having troubles with
mutexes (using in a parallel foreach loop somewhere else); Why do
the trylocks return true shouldn't they return false because the
mutex is already locked? I don't think this is a phobos bug, I'm
on OSX using dmd 2.065
import core.sync.mutex;
import std.stdio;
void main()
{
Mutex m = new Mutex;
m.lock();
writefln("%s", m.tryLock());
writefln("%s", m.tryLock());
return;
}
produces:
true
true
Thanks!
Alex
More information about the Digitalmars-d-learn
mailing list