[omniORB] AIX & omni threads

Boris Khanales boris@imagine-sw.com
Tue, 4 Jan 2000 13:43:19 -0500 (EST)


I'm using 
AIX aixdev 3 4
and I'm always getting exception after call to nanosleep.

Any idea?
Shall I define NoNanoSleep?
If yes - where and shall I define it for me application ???

Do I missing any patches or link with wrong libraries?

Help !!!


void
omni_thread::sleep(unsigned long secs, unsigned long nanosecs)
{
    timespec rqts = { secs, nanosecs };

#ifndef NoNanoSleep

!!! !!! !!!    if (nanosleep(&rqts, (timespec*)NULL) != 0)
	throw omni_thread_fatal(errno);
#else

#if defined(__osf1__) && defined(__alpha__) || defined(__hpux__) && 
(__OSVERSION__ == 10) || defined(__VMS) || defined(__SINIX__)

    if (pthread_delay_np(&rqts) != 0)
	throw omni_thread_fatal(errno);

#elif defined(__linux__) || defined(__aix__)

    if (secs > 2000) {
	::sleep(secs);
    } else {
	usleep(secs * 1000000 + (nanosecs / 1000));
    }

#else

    throw omni_thread_invalid();

#endif
#endif	/* NoNanoSleep */
}