Changeset c47e1a8 in mainline for kernel/generic/src/synch/waitq.c
- Timestamp:
- 2010-05-21T07:50:04Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d51ee2b
- Parents:
- cf8cc36 (diff), 15b592b (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/waitq.c
rcf8cc36 rc47e1a8 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.