On 18/02/10 at 06:51 -0000, Nigel Kersten wrote:
> I had a quick look at Timeout. The problem is there in:
> 
>       x = Thread.current
>       y = Thread.start {
>         sleep sec
>         x.raise exception, "execution expired" if x.alive?
>       }
> 
> and Thread x.status returns a sleep state even after the test execs
> complete, which seems pretty fundamentally broken...  I'll have a look
> and see if I can find a dupe
> 
> confirmed on stock Lucid and Debian testing.

No, that's not a bug. How it works is that the code is executed (yield
sec), and if it finishes before the timeout, the thread is killed
(y.kill if y and y.alive?), so the exception is never raised.

So, on the paper, it looks correct. However, I'm not sure of the
atomicity guarantees provided by the interpreter here. Might be a
problem.
-- 
| Lucas Nussbaum
| [email protected]   http://www.lucas-nussbaum.net/ |
| jabber: [email protected]             GPG: 1024D/023B3F4F |

-- 
building ruby1.8 with pthread support causes puppet hangs
https://bugs.launchpad.net/bugs/520715
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to