I find the following code in Concurrent.pmod:
void success(mixed value) { if (state) error("Promise has already been finalized.\n"); object key = mux->lock(); if (state) error("Promise has already been finalized.\n"); unlocked_success(value); key = 0; }
Now, I realise that the first error() will trigger without acquiring the lock. Is this done because you want to catch coding errors *inside* Concurrent.pmod where you acquire the lock first, then try to finalise again? If so, I'd almost say that the first "if" should be turned into an assert-kind of check which should be skipped in production code.