Changes in kernel/generic/include/synch/condvar.h [e88eb48:0b47781] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/condvar.h
re88eb48 r0b47781 1 1 /* 2 2 * Copyright (c) 2001-2004 Jakub Jermar 3 * Copyright (c) 2025 Jiří Zárevúcky 3 4 * All rights reserved. 4 5 * … … 46 47 } condvar_t; 47 48 48 #define condvar_wait(cv, mtx) \ 49 _condvar_wait_timeout((cv), (mtx), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 50 #define condvar_wait_timeout(cv, mtx, usec) \ 51 _condvar_wait_timeout((cv), (mtx), (usec), SYNCH_FLAGS_NONE) 49 #define CONDVAR_INITIALIZER(name) (condvar_t) { \ 50 .wq = WAITQ_INITIALIZER((name).wq), \ 51 } 52 52 53 #ifdef CONFIG_SMP 54 #define _condvar_wait_timeout_spinlock(cv, lock, usec, flags) \ 55 _condvar_wait_timeout_spinlock_impl((cv), (lock), (usec), (flags)) 56 #else 57 #define _condvar_wait_timeout_spinlock(cv, lock, usec, flags) \ 58 _condvar_wait_timeout_spinlock_impl((cv), NULL, (usec), (flags)) 59 #endif 53 #define CONDVAR_INITIALIZE(name) \ 54 condvar_t name = CONDVAR_INITIALIZER(name) 60 55 61 56 extern void condvar_initialize(condvar_t *cv); 62 57 extern void condvar_signal(condvar_t *cv); 63 58 extern void condvar_broadcast(condvar_t *cv); 64 extern errno_t _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, 65 int flags); 66 extern errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 67 uint32_t usec, int flags); 68 extern errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv, 69 irq_spinlock_t *irq_lock, uint32_t usec, int flags); 59 60 extern errno_t __condvar_wait_mutex(condvar_t *cv, mutex_t *mtx); 61 extern errno_t __condvar_wait_spinlock(condvar_t *cv, spinlock_t *mtx); 62 extern errno_t __condvar_wait_irq_spinlock(condvar_t *cv, irq_spinlock_t *mtx); 63 extern errno_t __condvar_wait_timeout_mutex(condvar_t *cv, mutex_t *mtx, uint32_t usec); 64 extern errno_t __condvar_wait_timeout_spinlock(condvar_t *cv, spinlock_t *mtx, uint32_t usec); 65 extern errno_t __condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *mtx, uint32_t usec); 66 67 #define condvar_wait(cv, mtx) (_Generic((mtx), \ 68 mutex_t *: __condvar_wait_mutex, \ 69 spinlock_t *: __condvar_wait_spinlock, \ 70 irq_spinlock_t *: __condvar_wait_irq_spinlock \ 71 )(cv, mtx)) 72 73 #define condvar_wait_timeout(cv, mtx, usec) (_Generic((mtx), \ 74 mutex_t *: __condvar_wait_timeout_mutex, \ 75 spinlock_t *: __condvar_wait_timeout_spinlock, \ 76 irq_spinlock_t *: __condvar_wait_timeout_irq_spinlock \ 77 )(cv, mtx)) 70 78 71 79 #endif
Note:
See TracChangeset
for help on using the changeset viewer.