|
Boost Users : |
Subject: Re: [Boost-users] [Thread] Timed join returning true before thread terminated
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2012-03-16 04:51:35
On 15/03/12 22:44, Vicente J. Botet Escriba wrote:
> I agree that disabling interrupts is the correct way to avoid new
> interruptions. But you need to clear them before.
Disabling interrupts doesn't stop the flag being set, it just stops the
interruption points acting on it. There is thus no need to clear the
flag. If you want to call code with an interruption point without being
interrupted, disable interruptions. Whether or not the flag is set
beforehand, or set during the call is now irrelevant. It may or may not
be set at the end of the block either way.
Anthony
-- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++11 thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net