Changeset 597fa24 in mainline for kernel/generic/include/synch/waitq.h


Ignore:
Timestamp:
2025-04-09T16:19:40Z (6 days ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master
Children:
9f945464, a188131
Parents:
3e7948c
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2025-04-09 16:08:09)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2025-04-09 16:19:40)
Message:

Enable static initialization of kernel synchronization primitives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/waitq.h

    r3e7948c r597fa24  
    4040#include <abi/synch.h>
    4141#include <adt/list.h>
     42
     43#define WAITQ_INITIALIZER_WITH_COUNT(name, count) (waitq_t) { \
     44        .lock = IRQ_SPINLOCK_INITIALIZER(#name ".lock"), \
     45        .sleepers = LIST_INITIALIZER((name).sleepers), \
     46        .wakeup_balance = (count), \
     47}
     48
     49#define WAITQ_INITIALIZER(name) WAITQ_INITIALIZER_WITH_COUNT(name, 0)
     50
     51#define WAITQ_INITIALIZE_WITH_COUNT(name, count) \
     52        waitq_t name = WAITQ_INITIALIZER_WITH_COUNT(name, count)
     53
     54#define WAITQ_INITIALIZE(name) \
     55        waitq_t name = WAITQ_INITIALIZER(name)
    4256
    4357/** Wait queue structure.
Note: See TracChangeset for help on using the changeset viewer.