Changeset e20eaf4


Ignore:
Timestamp:
Mar 29, 2021, 2:15:59 PM (7 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
976bc68
Parents:
31fc80f
Message:

Fixed incorrect comment in locks code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/locks.hfa

    r31fc80f re20eaf4  
    8282
    8383        // returns true if no blocking needed
    84         bool P(BinaryBenaphore & this) { return __atomic_fetch_sub(&this.counter, 1, __ATOMIC_SEQ_CST) > 0; }
     84        bool P(BinaryBenaphore & this) {
     85                return __atomic_fetch_sub(&this.counter, 1, __ATOMIC_SEQ_CST) > 0;
     86        }
     87
    8588        bool tryP(BinaryBenaphore & this) {
    8689                ssize_t c = this.counter;
     
    115118static inline void ?{}(ThreadBenaphore & this, one_t ) { (this.ben){ 1 }; }
    116119
    117 static inline bool P(ThreadBenaphore & this)              { return /* P(this.ben) ? false : */ P(this.sem); }
    118 static inline bool P(ThreadBenaphore & this, $thread * t) { return /* P(this.ben) ? false : */ P(this.sem, t ); }
     120static inline bool P(ThreadBenaphore & this)              { return P(this.ben) ? false : P(this.sem); }
     121static inline bool P(ThreadBenaphore & this, $thread * t) { return P(this.ben) ? false : P(this.sem, t ); }
    119122static inline bool tryP(ThreadBenaphore & this)           { return tryP(this.ben); }
    120123static inline bool P(ThreadBenaphore & this, bool wait)   { return wait ? P(this) : tryP(this); }
    121124
    122125static inline $thread * V(ThreadBenaphore & this, const bool doUnpark = true) {
    123         // if (V(this.ben)) return 0p;
     126        if (V(this.ben)) return 0p;
    124127        return V(this.sem, doUnpark);
    125128}
Note: See TracChangeset for help on using the changeset viewer.