Opened 6 years ago

Closed 6 years ago

#12389 closed Bugs (worksforme)

Timer expires immediately on Ubuntu 64-bit using boost 1.61

Reported by: boriss@… Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.61.0 Severity: Problem
Keywords: Linux 64-bit Cc:

Description

We are using boost:chrono and boost:thread for the Timer implementation. We have multi library application. Our libraries are linked with dynamic boost libraries. Some of our libraries with defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC and some without this define. After mixing this define we found out that timers expires immediately after they are started. If we defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC in all libraries then we didn't found this problem. We need this define to avoid problems described in boost ticket 11562.

More details about our implementation can be found in boost ticket 11562

https://svn.boost.org/trac/boost/ticket/11562

Change History (5)

comment:1 by viboes, 6 years ago

How is it that you have BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC some times defined and others not?

Could you elaborate how #11562 is related?

comment:2 by viboes, 6 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:3 by anonymous, 6 years ago

Our library needs the definition BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC, to assure system time changes do not affect timer timeout time - ticket #11562 was mentioned only, so you can check how our timers are implemented.

Other libraries that are linked to same application, were not written by us - they work ok without the definition BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC, a test build with this defition however failed in runtime.

General question is - is it required to have the same definition in all libraries used in application? If so, this is sometimes hard to achieve - e.g.: when you have libraries from different vendors linked together.

comment:4 by viboes, 6 years ago

Yes, is it required. BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC is something that is deduced from the underlying system. Either the system has them or it hasn't. BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC can be defined by the user only as a workaround to fix an issue on the Boost library.

We could as well issue an error if the user defines it.

comment:5 by viboes, 6 years ago

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.