Revision 1236 branches/threaded2merge/src/linad99/xthread_stuff.cpp

xthread_stuff.cpp (revision 1236)
68 68
    pthread_mutex_lock(ssmutex[s1]+s2);
69 69
    // only write if buffer empty
70 70
    while (smflag(s1,s2) == 1 || ssflag(s1,s2) == 1)
71
    {
72
      cout << __func__ << ';' << __LINE__ << endl;
71 73
      pthread_cond_wait(smcondition[s1]+s2,ssmutex[s1]+s2);
74
      cout << __func__ << ';' << __LINE__ << endl;
75
    }
72 76
  }
73 77
  else if (sno < tn2)  // old slave write to master
74 78
  {
......
77 81
    pthread_mutex_lock(ssmutex[s1]+s2);
78 82
    // only write if buffer empty
79 83
    while (smflag(s1,s2) == 1 || ssflag(s1,s2) == 1)
84
    {
85
      cout << __func__ << ':' << __LINE__ << endl;
80 86
      pthread_cond_wait(sscondition[s1]+s2,ssmutex[s1]+s2);
87
      cout << __func__ << ':' << __LINE__ << endl;
88
    }
81 89
  }
82 90
  else
83 91
  {
......
95 103
    scurrent_bptr[s1][s2]=stransfer_buffer[s1][s2];
96 104
    smflag(s1,s2) = 1;
97 105
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
98
    pthread_cond_signal(sscondition[s1]+s2);
106
      cout << __func__ << ';' << __LINE__ << endl;
107
    pthread_cond_broadcast(sscondition[s1]+s2);
108
      cout << __func__ << ';' << __LINE__ << endl;
99 109
    pthread_mutex_unlock(ssmutex[s1]+s2);
110
      cout << __func__ << ';' << __LINE__ << endl;
100 111
  }
101 112
  else if (sno < tn2)  // old slave write to master
102 113
  {
......
105 116
    scurrent_bptr[s1][s2]=stransfer_buffer[s1][s2];
106 117
    ssflag(s1,s2) = 1;
107 118
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
108
    pthread_cond_signal(smcondition[s1]+s2);
119
      cout << __func__ << ':' << __LINE__ << endl;
120
    pthread_cond_broadcast(smcondition[s1]+s2);
121
      cout << __func__ << ':' << __LINE__ << endl;
109 122
    pthread_mutex_unlock(ssmutex[s1]+s2);
123
      cout << __func__ << ':' << __LINE__ << endl;
110 124
  }
111 125
  else
112 126
  {

Also available in: Unified diff