Ingo Strüwing, 07.05.2009 08:47:
> Hi Konstantin,
> Konstantin Osipov, 06.05.2009 20:35:
>> But then what's the point of checking it twice -- why is it not
>> enough to check before we fall into pthread_cond_wait() and after
>> calling enter_cond()?
> The only point of checking it twice is that it makes less changes to the
> existing code.
> It would definitely be enough to check it only between enter_cond() and
I'm sorry. I was wrong. We need two checks.
The check within enter_cond()...exit_cond() is required to make the
detection of thd->killed more safe. But at this place we can't bail out.
We need to go through exit_cond() anyway.
The check outside of enter_cond()...exit_cond() can be used to leave a
loop if the thread is killed.
In some cases the inner check might be sufficient though.
Ingo Strüwing, Database Group
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring HRB München 161028