コード例 #1
0
ファイル: J1DMObj.cpp プロジェクト: neattools/neattools
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;
}
コード例 #2
0
ファイル: Thread.cpp プロジェクト: RuntimeTools/omr-agentcore
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);
}