Changeset 33a3be8 in mainline


Ignore:
Timestamp:
2023-02-05T14:43:59Z (15 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
07700ed
Parents:
c030818
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-15 19:35:23)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-05 14:43:59)
Message:

Modify semantics of WAKEUP_ALL slightly

Previous implementation saves the wakeup if no threads have
been woken up. IMO that is a counterintuitive behaviour and
limits usefulness of the function.

For context, the only current consumer of WAKEUP_ALL is condvar
broadcast, in which case there is always one extra spurious
wakeup going out. Condvar allows spurious wakeups, so it's
not an issue here, but there are other possible uses where
it can be a problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/waitq.c

    rc030818 r33a3be8  
    519519loop:
    520520        if (list_empty(&wq->sleepers)) {
    521                 wq->missed_wakeups++;
    522                 if ((count) && (mode == WAKEUP_ALL))
    523                         wq->missed_wakeups--;
     521                if (mode != WAKEUP_ALL) {
     522                        wq->missed_wakeups++;
     523                }
    524524
    525525                return;
Note: See TracChangeset for help on using the changeset viewer.