- Timestamp:
- Apr 15, 2021, 2:59:11 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:
- e2cc3c7
- Parents:
- c0c0bd5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/spinaphore.cfa
rc0c0bd5 r84cd72d 49 49 void main(Unblocker & this) { 50 50 this.sum = 0; 51 unsigned me = (unsigned) &this;51 unsigned me = (unsigned)(uintptr_t)&this; 52 52 for(num_unblocks) { 53 53 $thread * t = V(sem, false); 54 54 Blocker * b = from_thread(t); 55 55 b->sum += me; 56 this.sum += (unsigned) b;56 this.sum += (unsigned)(uintptr_t)b; 57 57 unpark(t); 58 58 yield(random(10)); … … 73 73 for(i;num_blockers) { 74 74 for(num_blocks) 75 usum += (unsigned) &blockers[i];75 usum += (unsigned)(uintptr_t)&blockers[i]; 76 76 } 77 77 78 78 for(i;num_unblockers) { 79 79 for(num_unblocks) 80 bsum += (unsigned) &unblockers[i];80 bsum += (unsigned)(uintptr_t)&unblockers[i]; 81 81 } 82 82
Note: See TracChangeset
for help on using the changeset viewer.