Changeset c74e601 for libcfa/src/concurrency/locks.hfa
- Timestamp:
- Dec 3, 2020, 4:38:01 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:
- bd8dca2
- Parents:
- 27b1ca1 (diff), cad1df1 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.hfa
r27b1ca1 rc74e601 5 5 #include "bits/algorithm.hfa" 6 6 #include "bits/locks.hfa" 7 #include "bits/sequence.hfa" 7 8 #include "bits/containers.hfa" 8 9 … … 31 32 forall(dtype L | is_blocking_lock(L)) { 32 33 struct info_thread { 34 inline Seqable; 33 35 struct $thread * t; 34 36 uintptr_t info; 35 info_thread(L) * next;36 37 L * lock; 37 38 bool listed; // true if info_thread is on queue, false otherwise; … … 42 43 void ?{}( info_thread(L) & this, $thread * t, uintptr_t info ); 43 44 void ^?{}( info_thread(L) & this ); 44 45 info_thread(L) *& get_next( info_thread(L) & this );46 45 } 47 46 … … 50 49 /////////////////////////////////////////////////////////////////// 51 50 51 // struct lock_thread { 52 // struct $thread * t; 53 // lock_thread * next; 54 // }; 55 56 // void ?{}( lock_thread & this, struct $thread * thd ); 57 // void ^?{}( lock_thread & this ); 58 59 // lock_thread *& get_next( lock_thread & ); 60 52 61 struct blocking_lock { 53 62 // Spin lock used for mutual exclusion … … 55 64 56 65 // List of blocked threads 57 __queue_t( struct$thread ) blocked_threads;66 __queue_t( $thread ) blocked_threads; 58 67 59 68 // Count of current blocked threads … … 135 144 __spinlock_t lock; 136 145 146 info_thread(L) * last_thread; 147 137 148 // List of blocked threads 138 __queue_t( info_thread(L) ) blocked_threads;149 Sequence( info_thread(L) ) blocked_threads; 139 150 140 151 // Count of current blocked threads … … 150 161 condition_variable(L) * cond; 151 162 152 info_thread(L) * *i;163 info_thread(L) * i; 153 164 }; 154 165
Note: See TracChangeset
for help on using the changeset viewer.