2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-25 18:52:16 +00:00
Commit Graph

399 Commits

Author SHA1 Message Date
Austin Beer
24fd5953c9 Fixed timed_join on Windows when the system clock jumps. 2017-09-21 11:27:36 -06:00
Austin Beer
de7e354a8e Improved the timespec implementation
* Added a constructor to timespec_duration, real_timespec_timepoint, and mono_timespec_timepoint that takes an intmax_t representing the number of nanoseconds in the timespec.
* Added a getNs() function to timespec_duration, real_timespec_timepoint, and mono_timespec_timepoint that returns an intmax_t representing the number of nanoseconds in the timespec.
* Added a timespec_milliseconds() function that takes an integer representing milliseconds and returns a timespec_duration.
* Removed some unnecessary BOOST_SYMBOL_VISIBLE declarations.
* Removed the unnecessary d100 variable declarations.
2017-09-21 09:28:18 -06:00
Austin Beer
285d35f43f Cleanup
* Deleted a couple of unnecessary calls to internal_clock_t::now() in v2/thread.hpp.
* Deleted the hidden::sleep_until() functions, which are no longer being used.
* Deleted the condition_variable::do_wait_for() function, which is no longer being used.
* Deleted the sleep_mutex and sleep_condition variables in pthread/thread_data.hpp, which are no longer being used.
2017-09-19 16:12:22 -06:00
Vicente J. Botet Escriba
a18dfa1fea Merge branch 'feature/timespec_clocks' of github.com:boostorg/thread into feature/timespec_clocks 2017-09-19 23:46:45 +02:00
Austin Beer
a9706f0745 Fixed sleep(TimeDuration const& rel_time) when internal clock is not monotonic but CLOCK_MONOTONIC is available. 2017-09-19 15:06:06 -06:00
Vicente J. Botet Escriba
8e718893e5 Merge branch 'feature/timespec_clocks' of github.com:boostorg/thread into feature/timespec_clocks 2017-09-19 22:09:38 +02:00
Austin Beer
aebbcda3fe Updates to fix interruption-point inconsistencies.
* Fixed the interruption-point versions of sleep_for/sleep_until() to always use condition variables.
* Fixed the no-interruption-point versions of sleep_for/sleep_until() to use pthread_delay_np or nanosleep whenever possible.
* Updated hidden::sleep_for() to always use a condition variable.
* Updated no_interruption_point::hidden::sleep_for() to use pthread_delay_np or nanosleep whenever possible.
2017-09-19 09:04:57 -06:00
Vicente J. Botet Escriba
5b4d230d4a Merge branch 'develop' into feature/timespec_clocks 2017-09-19 13:01:20 +02:00
Vicente J. Botet Escriba
48a2a960da remove some warnings. 2017-09-19 03:20:46 +02:00
Vicente J. Botet Escriba
576231942d Merge branch 'develop' into feature/timespec_clocks 2017-09-17 22:40:59 +02:00
Vicente J. Botet Escriba
82eed2ca6d make use of do_wait_until when BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC is defined as proposed by Austin Beer.. 2017-09-17 19:09:09 +02:00
Andrey Semashev
b64aad9869 Changed _pRawDllMain and related types to use HINSTANCE instead of HANDLE.
In MSVC-9 MFC sources, _pRawDllMain and ExtRawDllMain accept HINSTANCE as
the first argument, not HANDLE. In strict mode these are different types,
which creates the potential for ODR errors. This commit resolves that
inconsistency.

Resolves https://svn.boost.org/trac10/ticket/12323.
2017-09-16 20:47:10 +03:00
Vicente J. Botet Escriba
14deba107f minor chnages. 2017-09-07 22:41:31 +02:00
Vicente J. Botet Escriba
81fe14fda2 Update after test from brainwave64. 2017-09-04 07:35:33 +02:00
Vicente J. Botet Escriba
1063638763 Replace timespec by specific clock/timepoint/duration like classes that represent the monotonic, the real or the one used internaly at the platform level. Make use of these clocks/timepoints/durations almost all around. Need to replace yet all the occurrences of get_system_time(). 2017-09-02 14:42:25 +02:00
SSE4
e63257ff7f - switch to boost winapi, to avoid duplicated definitions when compiling using Clang on Windows 2017-08-31 14:52:13 +07:00
Andrey Semashev
349f59d92d Changed signatures of TLS cleanup hooks for consistency with MSVC RTL.
This should fix startup of executables statically linked with Boost.Thread
because of undefined return value of the thread/process startup hooks.

Should fix https://svn.boost.org/trac10/ticket/12730.
2017-08-27 19:17:23 +03:00
Vicente J. Botet Escriba
510e66aef7 rename make_ready to notify_deferred. 2017-08-26 10:39:31 +02:00
Vicente J. Botet Escriba
28bf345c96 make more evident that timespec is realtime and not monotonic. 2017-08-16 20:30:59 +02:00
David Olsen
047205fbbd Fix sleep_until() to use a realtime clock
boost::this_thread::no_interruption_point::hidden::sleep_until() takes an absolute time as a parameter and converts it to a duration for the length of time to sleep.  But the current time that the absolute time is compared against came from timespec_now(), which, on Linux at least, uses CLOCK_MONOTONIC, which "represents monotonic time since some unspecified starting point."  Since timespec_now() may have a different starting point than the time that was passed to sleep_until(), that can result in sleep_until() sleeping for an *extremely* long time, causing the program to appear to hang.

Change sleep_until() to get the current time from timespec_now_realtime(), which uses CLOCK_REALTIME, which has the same epoch as the time that is passed to sleep_until().
2017-08-02 15:19:32 -07:00
Vicente J. Botet Escriba
d83b7ddc0f Merge branch 'develop' of github.com:boostorg/thread into develop 2017-04-29 17:35:01 +02:00
Vicente J. Botet Escriba
5ee3e8d04b manage with #12888. 2017-04-29 16:17:07 +02:00
Marcel Raad
676521808d Remove wrong MSVC version check
There is no compiler with (_MSC_VER > 2000) and taking the legacy codepath would probably break compilation again when there is. As (_MSC_VER < 1300) (that would be MSVC up to 6.0 from 1998) is not supported by Boost anymore anyway and cannot compile Boost.Thread, this codepath can just be removed completely.
2017-03-24 22:28:41 +01:00
Aaron Gorenstein
bd0379af57 Update MSC version check for VS2017RTW 2017-02-21 13:35:44 -08:00
Andrey Semashev
49ab2e8619 Fixed compilation with MSVC-8.
Make sure _WIN32_WINNT is defined when windows.h is included. This is
achieved by (a) making sure boost/detail/winapi/config.hpp is included
before any other headers and (b) BOOST_USE_WINDOWS_H is defined so that
the header defines _WIN32_WINNT based on the default target Windows
version. This ensures that all APIs used by the implementation are
available.

Also extracted WIN32_LEAN_AND_MEAN definition to the Jamfile so that it is
consistently defined for all translation units instead of only tss*.cpp.
2016-07-16 19:50:46 +03:00
Vicente J. Botet Escriba
8d150587fa Merge pull request #87 from timblechmann/feature/msvc-2015
win32: compile fix for msvc2015
2016-06-28 14:19:10 +02:00
Tim Blechmann
206ff0ba7c win32: compile fix for msvc2015 2016-06-20 11:11:17 +02:00
Marcel Raad
ccca616330 Fix Windows version problems
- the target Windows version was hardcoded to Windows 95
  in thread.cpp if not already defined
- the include for BOOST_USE_WINAPI_VERSION was missing
2016-05-25 15:54:28 +02:00
Vicente J. Botet Escriba
2c3acef281 remove unuseful files. 2016-04-21 19:11:55 +02:00
Vicente J. Botet Escriba
587ad42548 fix hiden rename 2016-04-21 00:10:30 +02:00
Vicente J. Botet Escriba
57f34e1ea4 fix memory leak. 2016-04-20 23:52:30 +02:00
Vicente J. Botet Escriba
daae305bf7 fix memory leak. 2016-04-20 23:50:43 +02:00
Philippe Daouadi
e29a4129e8 fix leak in tls 2016-04-16 10:48:40 +02:00
Vicente J. Botet Escriba
47357de276 rollback BOOST_THREAD_PATCH. 2016-03-23 23:15:50 +01:00
Vicente J. Botet Escriba
317a735836 try to manage with #12036. 2016-03-05 11:07:54 +01:00
Andrey Semashev
408d82ded9 Fixed compilation on Windows
Add a missing include for get_milliseconds_until and namespace qualification.
2016-02-27 21:48:23 +03:00
Vicente J. Botet Escriba
c0fe04ecc9 ensure the void* in the cleanup is shared during the call. 2015-11-08 11:04:40 +01:00
Gaurav
40b3dc0c2c Remove duplicate conditional check.
thread_info already checked against Null at line no 86, no need to check again.
2015-11-03 14:28:37 +05:30
Vicente J. Botet Escriba
ddd26b5bb8 remove comments after \ continuator macro. 2015-10-04 18:06:59 +02:00
Vicente J. Botet Escriba
9a8759a3dd rollback physical_concurrency changes and take care of patch #10788. #11683. 2015-09-27 15:14:58 +02:00
Vicente J. Botet Escriba
9ac736a4c4 Apply patch fromPR - Do not wake up computer from sleep. #11368. 2015-09-27 14:30:16 +02:00
Vicente J. Botet Escriba
0fdd4fc620 remove comments. 2015-09-24 01:36:41 +02:00
Ben Wiederhake
baca517058 Avoid deprecated auto_ptr 2015-09-19 18:14:41 +02:00
Vicente J. Botet Escriba
242cf35c51 Try patch for oldticket #3926 - thread_specific_ptr + dlopen library causes a SIGSEGV 2015-09-08 19:24:15 +02:00
Vicente J. Botet Escriba
4d45da6c06 Apply patch #11302. 2015-05-18 21:26:46 +02:00
Vicente J. Botet Escriba
0218136ed7 Try to see if share_from_this helps on the thread sanitize data race. 2015-04-25 15:41:49 +02:00
Vicente J. Botet Escriba
1bd78bbeea cleanup commented code. 2015-04-25 11:16:03 +02:00
Vicente J. Botet Escriba
ec6a1fcf80 try to get rid of data race. 2015-03-10 00:48:12 +01:00
Vicente J. Botet Escriba
c678b3794b Crash issue while calling run_thread_exit_callbacks. Related to #11053. 2015-03-01 01:37:35 +01:00
Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)
cf1182ee99 Disable physical_concurrency() on Mingw32 alone. 2015-02-18 15:19:48 +00:00