From: Tom Felker Date: 2003-06-04T05:06:44+09:00 Subject: Re: thread-unsafe stuff: could you summarize? On Mon, 2003-06-02 at 03:24, Robert Klemme wrote: > > First, accesses to @deferRunning should be done synchronized. But: Why do > you introduce @deferRunning when you have already a Mutex? You can do > try_lock and locked? on a Mutex thread safe but without blocking the > current thread. Looking back, I can't remember why I even have that. If you remove all reference to @deferRunning, it'll work the way I want. > And: I have the feeling that in defer() a "not" is missing. Shouldn't it > read > > def defer > if not @deferRunning > .... > else > .... > end > end Well, it did work, but you're right, @deferRunning is pointless. Code always looks different when you look at it a week later. :-) I guess my question is, is it OK to pass blocks between threads like this? Also, am I doing the right thing with making it both a module and a class? -- Tom Felker 38% of statistics are made up on the spot.