Changeset 4039c77 in mainline for kernel/generic/src/synch/waitq.c


Ignore:
Timestamp:
2010-05-09T10:47:48Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5e984f2, e2fcdb1
Parents:
640ffe6
Message:

Add assertion to detect attempts to block when hodling a spinlock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/waitq.c

    r640ffe6 r4039c77  
    208208}
    209209
     210#define PARAM_NON_BLOCKING(flags, usec) \
     211        (((flags) & SYNCH_FLAGS_NON_BLOCKING) && ((usec) == 0))
     212
    210213/** Sleep until either wakeup, timeout or interruption occurs
    211214 *
     
    257260        ipl_t ipl;
    258261        int rc;
     262
     263        ASSERT(!PREEMPTION_DISABLED || PARAM_NON_BLOCKING(flags, usec));
    259264       
    260265        ipl = waitq_sleep_prepare(wq);
     
    344349        }
    345350        else {
    346                 if ((flags & SYNCH_FLAGS_NON_BLOCKING) && (usec == 0)) {
     351                if (PARAM_NON_BLOCKING(flags, usec)) {
    347352                        /* return immediatelly instead of going to sleep */
    348353                        return ESYNCH_WOULD_BLOCK;
Note: See TracChangeset for help on using the changeset viewer.