Changes in kernel/generic/src/synch/waitq.c [6c4a56f:2e4e706] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/waitq.c
r6c4a56f r2e4e706 49 49 #include <proc/scheduler.h> 50 50 #include <arch/asm.h> 51 #include < arch/types.h>51 #include <typedefs.h> 52 52 #include <time/timeout.h> 53 53 #include <arch.h> 54 54 #include <context.h> 55 55 #include <adt/list.h> 56 #include <arch/cycle.h> 56 57 57 58 static void waitq_sleep_timed_out(void *data); … … 207 208 } 208 209 210 #define PARAM_NON_BLOCKING(flags, usec) \ 211 (((flags) & SYNCH_FLAGS_NON_BLOCKING) && ((usec) == 0)) 212 209 213 /** Sleep until either wakeup, timeout or interruption occurs 210 214 * … … 256 260 ipl_t ipl; 257 261 int rc; 262 263 ASSERT((!PREEMPTION_DISABLED) || (PARAM_NON_BLOCKING(flags, usec))); 258 264 259 265 ipl = waitq_sleep_prepare(wq); … … 343 349 } 344 350 else { 345 if ( (flags & SYNCH_FLAGS_NON_BLOCKING) && (usec == 0)) {351 if (PARAM_NON_BLOCKING(flags, usec)) { 346 352 /* return immediatelly instead of going to sleep */ 347 353 return ESYNCH_WOULD_BLOCK; … … 373 379 if (!context_save(&THREAD->sleep_interruption_context)) { 374 380 /* Short emulation of scheduler() return code. */ 381 THREAD->last_cycle = get_cycle(); 375 382 spinlock_unlock(&THREAD->lock); 376 383 return ESYNCH_INTERRUPTED; … … 385 392 if (!context_save(&THREAD->sleep_timeout_context)) { 386 393 /* Short emulation of scheduler() return code. */ 394 THREAD->last_cycle = get_cycle(); 387 395 spinlock_unlock(&THREAD->lock); 388 396 return ESYNCH_TIMEOUT;
Note:
See TracChangeset
for help on using the changeset viewer.