Changeset 132ab5d1 in mainline for kernel/generic/src/synch/condvar.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (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.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

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

    r8bfb163 r132ab5d1  
    8080 * For exact description of meaning of possible combinations of usec and flags,
    8181 * see comment for waitq_sleep_timeout().  Note that when
    82  * SYNCH_FLAGS_NON_BLOCKING is specified here, ESYNCH_WOULD_BLOCK is always
     82 * SYNCH_FLAGS_NON_BLOCKING is specified here, EAGAIN is always
    8383 * returned.
    8484 *
     
    8989        int rc;
    9090        ipl_t ipl;
     91        bool blocked;
    9192
    9293        ipl = waitq_sleep_prepare(&cv->wq);
     
    9596
    9697        cv->wq.missed_wakeups = 0;      /* Enforce blocking. */
    97         rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags);
     98        rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags, &blocked);
     99        assert(blocked || rc != EOK);
    98100
    99         waitq_sleep_finish(&cv->wq, rc, ipl);
     101        waitq_sleep_finish(&cv->wq, blocked, ipl);
    100102        /* Lock only after releasing the waitq to avoid a possible deadlock. */
    101103        mutex_lock(mtx);
     
    117119 * For exact description of meaning of possible combinations of usec and flags,
    118120 * see comment for waitq_sleep_timeout().  Note that when
    119  * SYNCH_FLAGS_NON_BLOCKING is specified here, ESYNCH_WOULD_BLOCK is always
     121 * SYNCH_FLAGS_NON_BLOCKING is specified here, EAGAIN is always
    120122 * returned.
    121123 *
     
    127129        int rc;
    128130        ipl_t ipl;
    129        
     131        bool blocked;
     132
    130133        ipl = waitq_sleep_prepare(&cv->wq);
    131134
     
    134137
    135138        cv->wq.missed_wakeups = 0;      /* Enforce blocking. */
    136         rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags);
     139        rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags, &blocked);
     140        assert(blocked || rc != EOK);
    137141
    138         waitq_sleep_finish(&cv->wq, rc, ipl);
     142        waitq_sleep_finish(&cv->wq, blocked, ipl);
    139143        /* Lock only after releasing the waitq to avoid a possible deadlock. */
    140144        spinlock_lock(lock);
     
    152156 * For exact description of meaning of possible combinations of usec and flags,
    153157 * see comment for waitq_sleep_timeout().  Note that when
    154  * SYNCH_FLAGS_NON_BLOCKING is specified here, ESYNCH_WOULD_BLOCK is always
     158 * SYNCH_FLAGS_NON_BLOCKING is specified here, EAGAIN is always
    155159 * returned.
    156160 *
Note: See TracChangeset for help on using the changeset viewer.