Changeset baafe71 in mainline
- Timestamp:
- 2006-05-25T10:04:05Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fd4d8c0
- Parents:
- 47800e0
- Location:
- generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/synch/condvar.h
r47800e0 rbaafe71 40 40 41 41 #define condvar_wait(cv,mtx) \ 42 _condvar_wait_timeout((cv),(mtx),SYNCH_NO_TIMEOUT,SYNCH_BLOCKING) 43 #define condvar_trywait(cv,mtx) \ 44 _condvar_wait_timeout((cv),(mtx),SYNCH_NO_TIMEOUT,SYNCH_NON_BLOCKING) 42 _condvar_wait_timeout((cv),(mtx),SYNCH_NO_TIMEOUT) 45 43 #define condvar_wait_timeout(cv,mtx,usec) \ 46 _condvar_wait_timeout((cv),(mtx),(usec) ,SYNCH_NON_BLOCKING)44 _condvar_wait_timeout((cv),(mtx),(usec)) 47 45 48 46 extern void condvar_initialize(condvar_t *cv); 49 47 extern void condvar_signal(condvar_t *cv); 50 48 extern void condvar_broadcast(condvar_t *cv); 51 extern int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec , int trywait);49 extern int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec); 52 50 53 51 #endif -
generic/src/synch/condvar.c
r47800e0 rbaafe71 75 75 * @param mtx Mutex. 76 76 * @param usec Timeout value in microseconds. 77 * @param trywait Blocking versus non-blocking operation mode switch.78 77 * 79 * For exact description of possible combinations of80 * usec and trywait,see comment for waitq_sleep_timeout().78 * For exact description of meaning of possible values of usec, 79 * see comment for waitq_sleep_timeout(). 81 80 * 82 81 * @return See comment for waitq_sleep_timeout(). 83 82 */ 84 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec , int trywait)83 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec) 85 84 { 86 85 int rc; … … 89 88 ipl = waitq_sleep_prepare(&cv->wq); 90 89 mutex_unlock(mtx); 91 92 rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, trywait); 90 91 cv->wq.missed_wakeups = 0; /* Enforce blocking. */ 92 rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, SYNCH_BLOCKING); 93 93 94 94 mutex_lock(mtx);
Note:
See TracChangeset
for help on using the changeset viewer.