Changeset 90152a4 for tests/concurrent/signal/wait.c
- Timestamp:
- Aug 27, 2018, 4:40:34 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b7c89aa
- Parents:
- f9feab8 (diff), 305581d (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/wait.c (moved) (moved from src/tests/concurrent/signal/wait.c ) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/signal/wait.c
rf9feab8 r90152a4 5 5 6 6 7 #include <fstream> 8 #include <kernel> 9 #include <monitor> 10 #include <stdlib> 11 #include <thread> 7 #include <fstream.hfa> 8 #include <kernel.hfa>hfa> 9 #include <monitor.hfa> 10 #include <stdlib.hfa> 11 #include <thread.hfa> 12 #include <time.hfa> 12 13 13 #include <time.h> 14 15 static const unsigned long N = 2_500ul; 14 #define __kick_rate 12000ul 15 #include "long_tests.h" 16 16 17 17 #ifndef PREEMPTION_RATE 18 #define PREEMPTION_RATE 10 _000ul18 #define PREEMPTION_RATE 10`ms 19 19 #endif 20 20 21 unsigned intdefault_preemption() {21 Duration default_preemption() { 22 22 return PREEMPTION_RATE; 23 23 } 24 25 #ifdef TEST_LONG 26 static const unsigned long N = 375_000ul; 27 #else 28 static const unsigned long N = 2_500ul; 29 #endif 24 30 25 31 monitor global_t {}; … … 87 93 // Waiter ABC 88 94 void main( WaiterABC & this ) { 89 for( int i = 0; i < N; i++ ) {95 for( int i = 0; TEST(i < N); i++ ) { 90 96 wait( condABC, globalA, globalB, globalC ); 97 KICK_WATCHDOG; 91 98 } 92 99 … … 97 104 // Waiter AB 98 105 void main( WaiterAB & this ) { 99 for( int i = 0; i < N; i++ ) {106 for( int i = 0; TEST(i < N); i++ ) { 100 107 wait( condAB , globalA, globalB ); 108 KICK_WATCHDOG; 101 109 } 102 110 … … 107 115 // Waiter AC 108 116 void main( WaiterAC & this ) { 109 for( int i = 0; i < N; i++ ) {117 for( int i = 0; TEST(i < N); i++ ) { 110 118 wait( condAC , globalA, globalC ); 119 KICK_WATCHDOG; 111 120 } 112 121 … … 117 126 // Waiter BC 118 127 void main( WaiterBC & this ) { 119 for( int i = 0; i < N; i++ ) {128 for( int i = 0; TEST(i < N); i++ ) { 120 129 wait( condBC , globalB, globalC ); 130 KICK_WATCHDOG; 121 131 } 122 132 … … 127 137 // Main 128 138 int main(int argc, char* argv[]) { 129 random_seed( time( NULL ) );139 srandom( time( NULL ) ); 130 140 waiter_left = 4; 131 141 processor p[2];
Note:
See TracChangeset
for help on using the changeset viewer.