Changeset 29e7cc7 in mainline for kernel/generic/include/synch/mutex.h


Ignore:
Timestamp:
2025-04-18T15:14:10Z (2 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
e77c3ed
Parents:
800d188 (diff), 25fdb2d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'upstream/master' into helenraid

File:
1 edited

Legend:

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

    r800d188 r29e7cc7  
    4444        MUTEX_PASSIVE,
    4545        MUTEX_RECURSIVE,
    46         MUTEX_ACTIVE
    4746} mutex_type_t;
    4847
     
    5150typedef struct {
    5251        mutex_type_t type;
     52        int nesting;
    5353        semaphore_t sem;
    54         struct thread *owner;
    55         unsigned nesting;
     54        _Atomic(struct thread *) owner;
    5655} mutex_t;
     56
     57#define MUTEX_INITIALIZER(name, mtype) (mutex_t) { \
     58        .type = (mtype), \
     59        .nesting = 0, \
     60        .sem = SEMAPHORE_INITIALIZER((name).sem, 1), \
     61        .owner = NULL, \
     62}
     63
     64#define MUTEX_INITIALIZE(name, mtype) \
     65        mutex_t name = MUTEX_INITIALIZER(name, mtype)
    5766
    5867extern void mutex_initialize(mutex_t *, mutex_type_t);
Note: See TracChangeset for help on using the changeset viewer.