R: [omniORB] Omni Thread

Sandro Tolaini tolaini@libero.it
Thu, 21 Jun 2001 10:38:09 +0200


> The call to timedwait() is never returning.

You have to grab the lock before timedwait()ing:

CClass::A_Function_Running_In_A_Different_omni_thread
{
	unsigned long lAbsSec, lAbsnSec;
	omni_thread::get_time(&lAbsSec, &lAbsnSec, 5, 0);

	omni_mutex_lock lock(*m_mtxThreadCond); // <== look here
	int n = m_pThreadCond->timedwait(lAbsSec, lAbsnSec);
}

POSIX conditional variables have a strange semantic... :)

Cheers,
  Sandro.