Changeset b067d9b for tests/concurrent/signal/block.cfa
- Timestamp:
- Oct 29, 2019, 4:01:24 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 773db65, 9421f3d8
- Parents:
- 7951100 (diff), 8364209 (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 moved
-
tests/concurrent/signal/block.cfa (moved) (moved from src/tests/concurrent/signal/block.c ) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/signal/block.cfa
r7951100 rb067d9b 7 7 8 8 9 #include <fstream> 10 #include <kernel> 11 #include <monitor> 12 #include <stdlib> 13 #include <thread> 14 #include <time> 9 #include <fstream.hfa> 10 #include <kernel.hfa> 11 #include <monitor.hfa> 12 #include <stdlib.hfa> 13 #include <thread.hfa> 14 #include <time.hfa> 15 16 #include "long_tests.hfa" 15 17 16 18 #ifndef PREEMPTION_RATE … … 22 24 } 23 25 24 #ifdef LONG_TEST26 #ifdef TEST_LONG 25 27 static const unsigned long N = 150_000ul; 26 28 #else … … 55 57 56 58 if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) { 57 sout | "ERROR Barging detected, expected" | a.last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread | endl;59 sout | "ERROR Barging detected, expected" | a.last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread; 58 60 abort(); 59 61 } … … 66 68 thread Waiter {}; 67 69 void main( Waiter & this ) { 68 for( int i = 0; i < N; i++ ) {70 for( int i = 0; TEST(i < N); i++ ) { 69 71 wait_op( globalA, globalB, i ); 72 KICK_WATCHDOG; 70 73 } 71 74 } … … 82 85 83 86 if( ! signal_block( cond ) ) { 84 sout | "ERROR expected to be able to signal" | endl;87 sout | "ERROR expected to be able to signal"; 85 88 abort(); 86 89 } … … 89 92 90 93 if(a.last_thread != next || b.last_thread != next) { 91 sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread | endl;94 sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread; 92 95 abort(); 93 96 } … … 127 130 Signaller s[4]; 128 131 Barger b[13]; 129 sout | "Starting waiters" | endl;132 sout | "Starting waiters"; 130 133 { 131 134 Waiter w[3]; 132 135 } 133 sout | "Waiters done" | endl;136 sout | "Waiters done"; 134 137 done = true; 135 138 }
Note:
See TracChangeset
for help on using the changeset viewer.