Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/unified_locking/locks.cfa

    r22b7579 r84f49be  
    1515condition_variable( owner_lock ) c_o;
    1616
    17 fast_lock f;
    18 condition_variable( fast_lock ) c_f;
    19 
    2017thread T_C_M_WS1 {};
    2118
     
    7168                }
    7269                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);
    10170        }
    10271}
     
    286255        printf("Done Test 6\n");
    287256
    288         printf("Start Test 7: fast lock and condition variable single wait/notify\n");
    289         {
    290                 T_C_F_WS1 t1[2];
     257        printf("Start Test 7: multi acquisiton lock and condition variable multiple acquire and wait/notify\n");
     258        {
     259                T_C_M_WS2 t1[2];
    291260        }
    292261        printf("Done Test 7\n");
    293262
    294         printf("Start Test 8: fast lock and condition variable 3 wait/notify all\n");
    295         {
    296                 T_C_F_WB1 t1[4];
     263        printf("Start Test 8: owner lock and condition variable multiple acquire and wait/notify\n");
     264        {
     265                T_C_O_WS2 t1[2];
    297266        }
    298267        printf("Done Test 8\n");
    299268
    300         printf("Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify\n");
    301         {
    302                 T_C_M_WS2 t1[2];
    303         }
    304         printf("Done Test 9\n");
    305 
    306         printf("Start Test 10: owner lock and condition variable multiple acquire and wait/notify\n");
    307         {
    308                 T_C_O_WS2 t1[2];
    309         }
    310         printf("Done Test 10\n");
    311 
    312         printf("Start Test 11: no lock condition variable wait/notify\n");
     269        printf("Start Test 9: no lock condition variable wait/notify\n");
    313270        {
    314271                T_C_NLW t1;
    315272                T_C_NLS t2;
    316273        }
    317         printf("Done Test 11\n");
    318 
    319         printf("Start Test 12: locked condition variable wait/notify with front()\n");
     274        printf("Done Test 9\n");
     275
     276        printf("Start Test 10: locked condition variable wait/notify with front()\n");
    320277        {
    321278                T_C_S_WNF t1[2];
    322279        }
    323         printf("Done Test 12\n");
     280        printf("Done Test 10\n");
    324281
    325282        // removed to limit test duration. Full test is in long run tests
Note: See TracChangeset for help on using the changeset viewer.