Changeset c7c178b for libcfa/src/concurrency
- Timestamp:
- Mar 31, 2021, 2:13:47 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c60ef639
- Parents:
- 22b7579
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.hfa
r22b7579 rc7c178b 39 39 }; 40 40 41 static inline bool P(Semaphore0nary & this, $thread * thrd) __attribute__((artificial));42 41 static inline bool P(Semaphore0nary & this, $thread * thrd) { 43 42 /* paranoid */ verify(!(thrd->seqable.next)); … … 48 47 } 49 48 50 static inline bool P(Semaphore0nary & this) __attribute__((artificial));51 49 static inline bool P(Semaphore0nary & this) { 52 50 $thread * thrd = active_thread(); … … 56 54 } 57 55 58 static inline $thread * V(Semaphore0nary & this, const bool doUnpark = true) __attribute__((artificial));59 56 static inline $thread * V(Semaphore0nary & this, const bool doUnpark = true) { 60 57 $thread * next; … … 205 202 // open 'owner' before unlocking anyone 206 203 // so new and unlocked threads don't park incorrectly. 204 // This may require additional fencing on ARM. 207 205 this.owner = 0p; 208 206 209 return V(this.sem,true); 210 } 211 212 static inline size_t on_wait( fast_lock & this ) __attribute__((artificial)); 213 static inline void on_wakeup( fast_lock & this, size_t ) __attribute__((artificial)); 214 static inline void on_notify( fast_lock &, struct $thread * t ) __attribute__((artificial)); 207 return V(this.sem, true); 208 } 215 209 216 210 static inline size_t on_wait( fast_lock & this ) { unlock(this); return 0; }
Note: See TracChangeset
for help on using the changeset viewer.