Opened 17 years ago

Closed 13 years ago

#78 closed Bugs (Fixed)

pthread_delay_np() parm incorrect

Reported by: cpqlvc Owned by: glassfordm
Milestone: Component: threads
Version: None Severity:
Keywords: Cc:


aix.hpp #define's BOOST_HAS_PTHREAD_DELAY_NP, and in 
fact there is a prototype for pthread_delay_np() 
in /usr/include/pthread.h.  This function is invoked 
by thread.cpp thread::sleep(), after it calls 
to_timespec() to convert "xtime" to "timespec".  
to_timespec() essentially copies the two corresponding 
fields, so the parameter that's passed to 
pthread_delay_np() is relative to the Unix epoch.  On 
my RS/6000 AIX 4.3 box this results in an endless 

According to the man page for pthread_delay_np()

"The pthread_delay_np subroutine causes the calling 
thread to delay execution for a specified period of 
elapsed wall clock time. The period of time the thread 
waits is at least as long as the number of seconds and 
nanoseconds specified in the interval parameter."

I interpret this to mean that the parameters values is 
relative to the time that pthread_delay_np() is 
invoked.  I tested my hypothesis by changing 
thread::sleep() to invoke to_timespec_duration(), and 
this seems to work.



Change History (1)

comment:1 Changed 13 years ago by Markus Schöpflin

Status: assignedclosed
Logged In: YES 

This has been fixed on the RC_1_28_0 branch and has also
been merged to HEAD in 05/2002.
Note: See TracTickets for help on using tickets.