help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Timeouts for BlockClosures


From: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] Timeouts for BlockClosures
Date: Sun, 03 Apr 2011 18:57:22 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b2 Thunderbird/3.1.9

On 04/03/2011 05:43 PM, Holger Hans Peter Freyther wrote:
> On 04/03/2011 04:58 PM, Holger Hans Peter Freyther wrote:
> 
>>
>> Hi,
>> maybe you could help me to understand the Process/BlockClosure/Exception
>> interaction. I do have two issues. The first is that even if I manage to call
>> the timeout block I am still returning to the Delay and do not leave the
>> block. Any idea how I could leave the delay, execute all ensure blocks inside
>> the timeout?
>>
>> Eval [
>>     [(Delay forSeconds: 100000) wait] timeout: 1 do: ['Timedout' printNl].
>> ]
>

Hi again,

so Process>>#queueInterrupt: will leave the process suspended if it was
suspended during the interrupt. In my case I end with semaphore wait and no
other link is in the list. What will be the sequence of adding my own
queueInterrupt which will resume the process at the end? E.g. what happens if
we are on a socket?


                                [semaphore isNil
                                    ifTrue: [[self evaluate: aBlock
ifNotTerminated: [self suspend]]]
                                    ifFalse: [[self evaluate: aBlock
ifNotTerminated: [semaphore wait]]]].



reply via email to

[Prev in Thread] Current Thread [Next in Thread]