[haiku-commits] Re: haiku: hrev53945 - src/add-ons/kernel/drivers/disk/nvme src/system/kernel headers/private/kernel src/tests/add-ons/kernel/kernelland_emu

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 16 Mar 2020 15:20:47 +0100

Am 16/03/2020 um 14:04 schrieb waddlesplash:

Yes, that's not what this change is about at all. This change is about the case where the ConditionVariable is still alive, but we want to return from whatever function has the Entry without waiting on it.

Thanks for the explanation!

That is, something like this:
    ConditionVariableEntry e;
    ... attach to variable ....
    if (waitingOnWhateverCondition)
         return;

In this case, the condition we were waiting on finished between when we attached the condition variable and when we were going to Wait() on it, so there is no need to wait at all. Before this commit, this code was not valid, and now it is.

I'm not with you yet: why would you add an entry to a variable if you're not going to wait for it? I mean, you could simply test before adding it, or not?

Bye,
   Axel.

Other related posts: