- File:
-
- 1 edited
-
libcfa/src/concurrency/locks.hfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.hfa
r454f478 rac5816d 13 13 //----------------------------------------------------------------------------- 14 14 // is_blocking_lock 15 trait is_blocking_lock( L &| sized(L)) {15 trait is_blocking_lock(dtype L | sized(L)) { 16 16 // For synchronization locks to use when acquiring 17 17 void on_notify( L &, struct $thread * ); … … 31 31 // the info thread is a wrapper around a thread used 32 32 // to store extra data for use in the condition variable 33 forall( L &| is_blocking_lock(L)) {33 forall(dtype L | is_blocking_lock(L)) { 34 34 struct info_thread; 35 35 … … 120 120 //----------------------------------------------------------------------------- 121 121 // Synchronization Locks 122 forall( L &| is_blocking_lock(L)) {122 forall(dtype L | is_blocking_lock(L)) { 123 123 struct condition_variable { 124 124 // Spin lock used for mutual exclusion … … 157 157 bool wait( condition_variable(L) & this, L & l, uintptr_t info, Time time ); 158 158 } 159 160 //-----------------------------------------------------------------------------161 // Semaphore162 struct semaphore {163 __spinlock_t lock;164 int count;165 __queue_t($thread) waiting;166 };167 168 void ?{}(semaphore & this, int count = 1);169 void ^?{}(semaphore & this);170 bool P (semaphore & this);171 bool V (semaphore & this);172 bool V (semaphore & this, unsigned count);
Note:
See TracChangeset
for help on using the changeset viewer.