Opened 20 years ago
Closed 17 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: |
Description
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 sleep. 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. Thanks, Doug
Note:
See TracTickets
for help on using tickets.