boolean J1DMObj::setNValue(int n, int _value) { _value = max(0, min(mask, _value)); if (_value != v[n]) { ov[n] = v[n]; v[n] = _value; condBroadcast(n); repaint(); return true; } return false; }
void stopAllThreads() { IBMRAS_DEBUG(fine,"in thread.cpp->stopAllThreads"); //prevent new thread creation pthread_mutex_lock(&threadMapMux); stopping = true; // wake currently sleeping threads condBroadcast(); while (!threadMap.empty()) { pthread_t top = threadMap.top(); pthread_cancel(top); //wait for the thread to stop pthread_mutex_unlock(&threadMapMux); pthread_join(top, NULL); pthread_mutex_lock(&threadMapMux); threadMap.pop(); } pthread_mutex_unlock(&threadMapMux); }