Revision 1235

branches/threaded2merge/src/linad99/ythread_stuff.cpp (revision 1235)
30 30
    pthread_mutex_lock(ssmutex[s1]+s2);
31 31
    scurrent_bptr[s1][s2]=stransfer_buffer[s1][s2];
32 32
    // only read if buffer full and data is for you
33
    while (ssflag(s1,s2) == 0) 
33
    while (ssflag(s1,s2) == 0)
34 34
      pthread_cond_wait(smcondition[s1]+s2,ssmutex[s1]+s2);
35 35
    // cout  << "A sflag=0" << endl;
36
    ssflag(s1,s2)=0; 
36
    ssflag(s1,s2)=0;
37 37
    save_identifier_string("WE");
38 38
    save_int_value(sno);
39 39
    save_int_value(tn2);
......
50 50
    pthread_mutex_lock(ssmutex[s1]+s2);
51 51
    scurrent_bptr[s1][s2]=stransfer_buffer[s1][s2];
52 52
    // only write if buffer empty
53
    while (smflag(s1,s2) == 0) 
53
    while (smflag(s1,s2) == 0)
54 54
      pthread_cond_wait(sscondition[s1]+s2,ssmutex[s1]+s2);
55
    smflag(s1,s2)=0; 
55
    smflag(s1,s2)=0;
56 56
    save_identifier_string("H1");
57 57
    save_int_value(sno);
58 58
    save_int_value(tn2);
......
62 62
    gradient_structure::GRAD_STACK1->
63 63
              set_gradient_stack(::adjoint_adread_lock_buffer_2);
64 64
  }
65
}   
65
}
66 66
void adpthread_manager::cread_lock_buffer(int sno)
67 67
{
68 68
  if (logflag)
......
83 83
    pthread_mutex_lock(ssmutex[s1]+s2);
84 84
    scurrent_bptr[s1][s2]=stransfer_buffer[s1][s2];
85 85
    // only read if buffer full and data is for you
86
    while (ssflag(s1,s2) == 0) 
86
    while (ssflag(s1,s2) == 0)
87 87
      pthread_cond_wait(smcondition[s1]+s2,ssmutex[s1]+s2);
88
    ssflag(s1,s2)=0; 
88
    ssflag(s1,s2)=0;
89 89
  }
90 90
  else
91 91
  {
......
94 94
    pthread_mutex_lock(ssmutex[s1]+s2);
95 95
    scurrent_bptr[s1][s2]=stransfer_buffer[s1][s2];
96 96
    // only write if buffer empty
97
    while (smflag(s1,s2) == 0) 
97
    while (smflag(s1,s2) == 0)
98 98
      pthread_cond_wait(sscondition[s1]+s2,ssmutex[s1]+s2);
99
    smflag(s1,s2)=0; 
99
    smflag(s1,s2)=0;
100 100
  }
101
}   
101
}
102 102
void adjoint_adread_lock_buffer_1(void)
103 103
{
104 104
  verify_identifier_string("ZE");
......
164 164
  // to get rid of global variables
165 165
  scurrent_bptr[s1][s2]=stransfer_buffer[s1][s2];
166 166
  // cout  << "adpthread_manager::adjoint_read_lock_buffer_slave(void)=1" << endl;
167
  ssflag(s1,s2)=1; 
167
  ssflag(s1,s2)=1;
168 168
  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
169 169
  pthread_cond_signal(smcondition[s1]+s2);
170 170
  pthread_mutex_unlock(ssmutex[s1]+s2);
......
194 194
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
195 195
    pthread_cond_signal(sscondition[s1]+s2);
196 196
    pthread_mutex_unlock(ssmutex[s1]+s2);
197
    
197

  
198 198
    save_identifier_string("G9");
199 199
    save_int_value(sno);
200 200
    save_int_value(tn2);
......
250 250
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
251 251
    pthread_cond_signal(sscondition[s1]+s2);
252 252
    pthread_mutex_unlock(ssmutex[s1]+s2);
253
    
253

  
254 254
    if (logflag)
255 255
    {
256 256
      double tm=adt[0].get_elapsed_time_and_reset();
......
296 296
  pthread_mutex_lock(ssmutex[s1]+s2);
297 297
  if (logflag)
298 298
  {
299
   // *(logfiles[0]) << "starting adjoint_read_unlock_buffer_master " << sno 
299
   // *(logfiles[0]) << "starting adjoint_read_unlock_buffer_master " << sno
300 300
     //              << endl;
301 301
    adt[0].get_elapsed_time_and_reset();
302 302
  }
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff