More Delay/Semaphore "fun"
Igor Stasenko
siguctua at gmail.com
Sat Oct 6 00:29:31 UTC 2007
> self waitOk: [ ".... working code .." ] ensureAfter: [ "This block
> will be evaluated only if we entered working block and regardless
> after it terminated or finished in regular way" ]
>
ohh.. yet again, there's no guarantees that code:
self waitOk: [ ".... working code .." ] ensureAfter: [ self signal ]
will exit with signalled state, because you can terminate process
after entering the ensureAfter block, but before sending #signal
message.
Then the only way is to make it to handle all by VM. And #critical:
code should look simply like:
critical: mutuallyExcludedBlock
self waitThenEvaluateAndSignalAfter: mutuallyExcludedBlock
--
Best regards,
Igor Stasenko AKA sig.
More information about the Squeak-dev
mailing list
|