Changeset 22b7579 for tests/unified_locking/locks.cfa
- Timestamp:
- Mar 31, 2021, 1:48:15 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c7c178b
- Parents:
- f621e43f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/unified_locking/locks.cfa
rf621e43f r22b7579 15 15 condition_variable( owner_lock ) c_o; 16 16 17 fast_lock f; 18 condition_variable( fast_lock ) c_f; 19 17 20 thread T_C_M_WS1 {}; 18 21 … … 68 71 } 69 72 unlock(s); 73 } 74 } 75 76 thread T_C_F_WS1 {}; 77 78 void main( T_C_F_WS1 & this ) { 79 for (unsigned int i = 0; i < num_times; i++) { 80 lock(f); 81 if(empty(c_f) && i != num_times - 1) { 82 wait(c_f,f); 83 }else{ 84 notify_one(c_f); 85 } 86 unlock(f); 87 } 88 } 89 90 thread T_C_F_WB1 {}; 91 92 void main( T_C_F_WB1 & this ) { 93 for (unsigned int i = 0; i < num_times; i++) { 94 lock(f); 95 if(counter(c_f) == 3 || i == num_times - 1) { 96 notify_all(c_f); 97 }else{ 98 wait(c_f,f); 99 } 100 unlock(f); 70 101 } 71 102 } … … 255 286 printf("Done Test 6\n"); 256 287 257 printf("Start Test 7: multi acquisiton lock and condition variable multiple acquire and wait/notify\n"); 288 printf("Start Test 7: fast lock and condition variable single wait/notify\n"); 289 { 290 T_C_F_WS1 t1[2]; 291 } 292 printf("Done Test 7\n"); 293 294 printf("Start Test 8: fast lock and condition variable 3 wait/notify all\n"); 295 { 296 T_C_F_WB1 t1[4]; 297 } 298 printf("Done Test 8\n"); 299 300 printf("Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify\n"); 258 301 { 259 302 T_C_M_WS2 t1[2]; 260 303 } 261 printf("Done Test 7\n");262 263 printf("Start Test 8: owner lock and condition variable multiple acquire and wait/notify\n");304 printf("Done Test 9\n"); 305 306 printf("Start Test 10: owner lock and condition variable multiple acquire and wait/notify\n"); 264 307 { 265 308 T_C_O_WS2 t1[2]; 266 309 } 267 printf("Done Test 8\n");268 269 printf("Start Test 9: no lock condition variable wait/notify\n");310 printf("Done Test 10\n"); 311 312 printf("Start Test 11: no lock condition variable wait/notify\n"); 270 313 { 271 314 T_C_NLW t1; 272 315 T_C_NLS t2; 273 316 } 274 printf("Done Test 9\n");275 276 printf("Start Test 1 0: locked condition variable wait/notify with front()\n");317 printf("Done Test 11\n"); 318 319 printf("Start Test 12: locked condition variable wait/notify with front()\n"); 277 320 { 278 321 T_C_S_WNF t1[2]; 279 322 } 280 printf("Done Test 1 0\n");323 printf("Done Test 12\n"); 281 324 282 325 // removed to limit test duration. Full test is in long run tests
Note: See TracChangeset
for help on using the changeset viewer.