[omniORB] Nasty omni_thread::sleep bug in posix.cc

bjornw@fairplay.no bjornw@fairplay.no
15 Jan 1999 13:55:51 +0100


Hi there!

If I'm calling omni_thread::sleep() with an argument
greater that 2000 omni_thread:sleep() calls itself until my
stack is full....

This only happens for platforms that do not use nanosleep();

Here is how it should be:

void
omni_thread::sleep(unsigned long secs, unsigned long nsecs /*=3D0*/)
{
   ...
   if (nsecs > 2000) {
      // sleep(nsecs); // calls omni_thread::sleep(2000, 0);
      ::sleep(nsecs); // make sure we call correct sleep()
   }
   ...
}

bjornw>
-------------------------------------------------------
Bj=F8rn Wennberg              email: bjornw@fairplay.no=20
                               ms: +47 950 82 657
Senior Programmer           phone: +47 22405538
FairPlay International AS     fax: +47 22405539