Changeset 8f1a99e
- Timestamp:
- Jul 5, 2021, 4:58:07 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b7d94ac5
- Parents:
- 7f62b708
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/future.hfa
r7f62b708 r8f1a99e 37 37 38 38 // Fulfil the future, returns whether or not someone was unblocked 39 $thread* fulfil( future(T) & this, T result ) {39 thread$ * fulfil( future(T) & this, T result ) { 40 40 this.result = result; 41 41 return fulfil( (future_t&)this ); -
tests/concurrent/semaphore.cfa
r7f62b708 r8f1a99e 22 22 23 23 void main(Blocker & this) { 24 $thread* me = active_thread();24 thread$ * me = active_thread(); 25 25 this.sum = 0; 26 26 for(num_blocks) { … … 45 45 or else {} 46 46 47 $thread* t = V(ben, false);47 thread$ * t = V(ben, false); 48 48 if(t) { 49 49 this.sum += (unsigned)t; -
tests/concurrent/signal/block.cfa
r7f62b708 r8f1a99e 33 33 34 34 monitor global_data_t { 35 $thread* last_thread;36 $thread* last_signaller;35 thread$ * last_thread; 36 thread$ * last_signaller; 37 37 }; 38 38 … … 82 82 if( !is_empty( cond ) ) { 83 83 84 $thread * next = ( $thread* ) front( cond );84 thread$ * next = ( thread$ * ) front( cond ); 85 85 86 86 if( ! signal_block( cond ) ) { -
tests/concurrent/spinaphore.cfa
r7f62b708 r8f1a99e 21 21 void main(Blocker & this); 22 22 23 Blocker * from_thread( $thread* t) {23 Blocker * from_thread(thread$ * t) { 24 24 Blocker & nullb = *(Blocker*)0p; 25 $thread& nullt = (thread&)nullb;25 thread$ & nullt = (thread&)nullb; 26 26 uintptr_t offset = (uintptr_t)&nullt; 27 27 uintptr_t address = ((uintptr_t)t) - offset; … … 30 30 31 31 void main(Blocker & this) { 32 $thread* me = active_thread();32 thread$ * me = active_thread(); 33 33 Blocker * me1 = &this; 34 34 Blocker * me2 = from_thread(me); … … 51 51 unsigned me = (unsigned)(uintptr_t)&this; 52 52 for(num_unblocks) { 53 $thread* t = V(sem, false);53 thread$ * t = V(sem, false); 54 54 Blocker * b = from_thread(t); 55 55 b->sum += me; -
tests/unified_locking/fast.cfa
r7f62b708 r8f1a99e 7 7 struct MutexObj { 8 8 fast_lock l; 9 $thread* id;9 thread$ * id; 10 10 uint32_t sum; 11 11 }; … … 21 21 22 22 uint32_t cs() { 23 $thread* me = active_thread();23 thread$ * me = active_thread(); 24 24 uint32_t value; 25 25 lock(mo.l); -
tests/unified_locking/mcs.cfa
r7f62b708 r8f1a99e 7 7 struct MutexObj { 8 8 mcs_lock l; 9 $thread* id;9 thread$ * id; 10 10 size_t sum; 11 11 }; … … 21 21 22 22 unsigned cs() { 23 $thread* me = active_thread();23 thread$ * me = active_thread(); 24 24 unsigned value = (unsigned)me; 25 25 mcs_node n; -
tests/unified_locking/thread_test.cfa
r7f62b708 r8f1a99e 40 40 for (unsigned int i = 0; i < num_times; i++) { 41 41 dowork(buffer, work_unlocked); 42 lock( curr_lock);42 lock(*curr_lock); 43 43 //printf("lock: %d %p ENTER\n", i, &curr_lock); 44 44 //lock(norm_lock); 45 45 dowork(buffer, work_locked); 46 46 //printf("lock: %d %p LEAVE\n", i, &curr_lock); 47 unlock( curr_lock);47 unlock(*curr_lock); 48 48 //unlock(norm_lock); 49 49 lck = rand() % lockCount; … … 65 65 break; 66 66 default: 67 break; 67 break; 68 68 } 69 69 processor p[threadCount];
Note: See TracChangeset
for help on using the changeset viewer.