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

Reply via email to