Changes in tests/unified_locking/locks.cfa [0fc447c:5a46e09]
- File:
-
- 1 edited
-
tests/unified_locking/locks.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/unified_locking/locks.cfa
r0fc447c r5a46e09 15 15 condition_variable( owner_lock ) c_o; 16 16 17 fast_lock f; 18 condition_variable( fast_lock ) c_f; 19 17 20 linear_backoff_then_block_lock l; 18 21 condition_variable( linear_backoff_then_block_lock ) c_l; … … 71 74 } 72 75 unlock(s); 76 } 77 } 78 79 thread T_C_F_WS1 {}; 80 81 void main( T_C_F_WS1 & this ) { 82 for (unsigned int i = 0; i < num_times; i++) { 83 lock(f); 84 if(empty(c_f) && i != num_times - 1) { 85 wait(c_f,f); 86 }else{ 87 notify_one(c_f); 88 } 89 unlock(f); 90 } 91 } 92 93 thread T_C_F_WB1 {}; 94 95 void main( T_C_F_WB1 & this ) { 96 for (unsigned int i = 0; i < num_times; i++) { 97 lock(f); 98 if(counter(c_f) == 3 || i == num_times - 1) { 99 notify_all(c_f); 100 }else{ 101 wait(c_f,f); 102 } 103 unlock(f); 73 104 } 74 105 } … … 286 317 printf("Done Test 6\n"); 287 318 288 printf("Start Test 7: linear backoff lock and condition variable single wait/notify\n"); 319 printf("Start Test 7: fast lock and condition variable single wait/notify\n"); 320 { 321 T_C_F_WS1 t1[2]; 322 } 323 printf("Done Test 7\n"); 324 325 printf("Start Test 8: fast lock and condition variable 3 wait/notify all\n"); 326 { 327 T_C_F_WB1 t1[4]; 328 } 329 printf("Done Test 8\n"); 330 331 printf("Start Test 9: linear backoff lock and condition variable single wait/notify\n"); 289 332 { 290 333 T_C_L_WS1 t1[2]; 291 334 } 292 printf("Done Test 7\n");293 294 printf("Start Test 8: linear backoff lock and condition variable 3 wait/notify all\n");335 printf("Done Test 9\n"); 336 337 printf("Start Test 10: linear backoff lock and condition variable 3 wait/notify all\n"); 295 338 { 296 339 T_C_L_WB1 t1[4]; 297 340 } 298 printf("Done Test 8\n");299 300 printf("Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify\n");341 printf("Done Test 10\n"); 342 343 printf("Start Test 11: multi acquisiton lock and condition variable multiple acquire and wait/notify\n"); 301 344 { 302 345 T_C_M_WS2 t1[2]; 303 346 } 304 printf("Done Test 9\n");305 306 printf("Start Test 1 0: owner lock and condition variable multiple acquire and wait/notify\n");347 printf("Done Test 11\n"); 348 349 printf("Start Test 12: owner lock and condition variable multiple acquire and wait/notify\n"); 307 350 { 308 351 T_C_O_WS2 t1[2]; 309 352 } 310 printf("Done Test 1 0\n");311 312 printf("Start Test 1 1: no lock condition variable wait/notify\n");353 printf("Done Test 12\n"); 354 355 printf("Start Test 13: no lock condition variable wait/notify\n"); 313 356 { 314 357 T_C_NLW t1; 315 358 T_C_NLS t2; 316 359 } 317 printf("Done Test 1 1\n");318 319 printf("Start Test 1 2: locked condition variable wait/notify with front()\n");360 printf("Done Test 13\n"); 361 362 printf("Start Test 14: locked condition variable wait/notify with front()\n"); 320 363 { 321 364 T_C_S_WNF t1[2]; 322 365 } 323 printf("Done Test 1 2\n");324 } 366 printf("Done Test 14\n"); 367 }
Note:
See TracChangeset
for help on using the changeset viewer.