Simple lock up with delay + semaphore - not fixed with 0006576

Tom Phoenix rootbeer at redcat.com
Fri Jan 4 23:37:39 UTC 2008


On Jan 4, 2008 2:58 PM, Georg Köster <georg.koester at gmail.com> wrote:

> Delay timeoutSemaphore: s afterMSecs: 1.

Despite the comment in the source code, Delay
class>>timeoutSemaphore:afterMSecs: doesn't signal the given
semaphore; in fact, it never uses that parameter. That method should
be deprecated, if not simply removed. I've filed a bug report:

    http://bugs.squeak.org/view.php?id=6834

> I have this fix for my use-case: Avoid Delay>>timeoutSempaphore:afterMSecs:

> |s|
> s := Semaphore new.
> [(Delay forSeconds:1) wait. s signal.] fork.
> s wait.
> Transcript show: 'Now gets here - line will be printed'; cr.

> Resource intense, I know.

Why; because you used fork? Squeak processes don't work the way you
might think. I would recommend a solution along those exact lines.

Hope this helps!

--Tom Phoenix



More information about the Squeak-dev mailing list