2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-23 06:02:14 +00:00
Commit Graph

430 Commits

Author SHA1 Message Date
Daniel Krügler
636e4a869c #348 Tolerable delay in interruptible_wait on Win32 is too long
Ensure that SetWaitableTimerEx's TolerableDelay parameter is clamped between 32 and 1000 ms when computing the 5% deviation.
2021-08-17 18:50:24 +02:00
Peter Dimov
409c98f8b7 Merge pull request #317 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74
2020-08-25 17:23:02 +03:00
Nikita Kniazev
7afa3e9fd4 Fixed optimized away hooks. Fixes #316
MSVC learned to not emit unreferenced symbols with internal linkage and the
hooks were defined in unnamed namespace which forces internal linkage, even if
you mark a variable `extern`.

Since Boost does not have a stable ABI, does not mangle the namespace with
the version, and the hooks are in `boost` namespace (`boost::on_*`) -- there is
no point in trying to hide some symbols because mixing different versions of
boost static libraries will not work already.

I also renamed the `__xl_ca` variable for consistency and because using double
underscored identifiers is forbidden. (`[lex.name]/3`)

The `extern const` is for verbosity and because they are indeed const (it is
done via pragma already).
2020-06-14 17:13:15 +03:00
Edward Diener
30f0ec41fe The corrected DLL entry point for the Embarcadero clang-based compilers. 2020-04-18 17:21:30 -04:00
Edward Diener
1c28a63e26 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 22:29:17 -04:00
Wyatt O'Day
8190a50838 Fix MSVC ARM64 build errors, issue #281 2019-05-09 15:18:59 -04:00
Austin Beer
48a4a06f86 Fix Issue 275
* Re-fixed the EINTR bug that exists in some pthreads implementations.
It was originally fixed in https://svn.boost.org/trac10/ticket/6200 and
was accidentally disabled in 5b209c2e83.
* Made sure that the fix for the EINTR bug was consistently applied to
all code in the library.
* Made sure that all pthread_mutex_*() and pthread_cond_*() function
calls in the library were consistently decorated with
BOOST_THREAD_DISABLE_THREAD_SAFETY_ANALYSIS.
2019-04-01 10:00:57 -06:00
Nikita Kniazev
970dcb8afd Simplify TSS cleanup routines. Fixes #236
Instead of wrapping a default or user provided destructor into a virtual
class and placing it into a shared_ptr it is now stored directly with
an elided type, to not introduce UB it is not called directly but through
a helper function which casts it back to the original type before calling.
2018-11-17 15:25:27 +03:00
Vicente J. Botet Escriba
e1b5f9d786 Try to catch the CircleCi clang issues. 2018-10-18 18:59:49 +02:00
Peter Dimov
54871e21a1 Fix uses of BOOST_HAS_WINTHREADS (not correct on Cygwin) 2018-10-13 04:56:08 +03:00
Vicente J. Botet Escriba
8c1d232b8c try to manage with #11477. 2018-09-15 07:11:37 +02:00
huangqinjin
d1284b02ad fix compilation with BOOST_NO_EXCEPTIONS 2018-08-31 10:54:35 +08:00
Frédéric Bron
ee607c86d4 Fixed warning cast between incompatible function types from FARPROC_ to gettickcount64_t
On Windows, GetProcAddress must be cast to something useful which
generates a warning with gcc. This patch silents the warning.

Fixes issue #225
2018-08-09 10:16:05 +02:00
Vicente J. Botet Escriba
de7608f067 manage #224: thread::physical_concurrency() allocates a buffer that is bigger than necessary. 2018-08-07 14:19:32 +02:00
Vicente J. Botet Escriba
4d62627668 Make it possible to compile with BOOST_NO_EXCEPTIONS defined 2018-04-13 20:06:03 +02:00
Andrey Semashev
3a95ba8559 Added periodic refresh calls to emulated GetTickCount64.
Periodic refreshes make sure that the 32-bit GetTickCount wraparounds are
properly counted even if the user doesn't call GetTickCount64 for extended
periods of time.
2018-02-21 20:05:45 +03:00
Andrey Semashev
8633d7532d Rewritten GetTickCount64 emulation implementation.
This is to resolve the possible license violation as the previous
implementation has been taken from StackOverflow and was not licensed
under the Boost Software License. The new implementation was adopted from
Boost.Log:

1cc577cbf5/src/timestamp.cpp (L66-L86)

The legal issue has been raised in:

https://lists.boost.org/Archives/boost/2018/02/241453.php

Fixes https://github.com/boostorg/thread/issues/209.
2018-02-21 00:44:20 +03:00
Vicente J. Botet Escriba
f855cb31d1 merge from develop with some winapp merge issues. 2018-01-28 14:37:53 +01:00
Brian Kuhl
669f652f4d Add CPU count for VxWorks 2018-01-12 01:08:11 -05:00
Andrey Semashev
343230cd78 Updated Boost.WinAPI usage to the new location and namespace. 2017-10-25 01:09:24 +03:00
Austin Beer
3c01e39481 Add and fix sleep functions
- Added no_interruption_point::sleep() functions to pthreads to be
  consistent with Windows.
- Fixed an issue where the no_interruption_point::sleep_*() functions
  were still interruptible on Windows.
2017-10-13 11:48:05 -06:00
Austin Beer
7069c97a8b Fixing lost notification bugs, part 1
- Updated all of the functions in all of the condition variable classes to ensure that they don't lose notifications
- Re-enabled notification tests
2017-10-11 10:03:04 -06:00
Austin Beer
82e2c82e95 Renaming timespec to platform 2017-10-02 09:23:54 -06:00
Austin Beer
5ffca91e60 * Hopefully fixed the build failure on Mac OS.
* Refactored to use timespec as the internal storage with pthread and intmax_t with Windows.
2017-09-29 10:22:01 -06:00
Austin Beer
3c25ad09ce Attempting to fix build errors on Windows. 2017-09-29 00:34:47 -06:00
Austin Beer
a2e037bb54 Fixes and Cleanup
- Fixed build failures on Windows. The timespec struct is not supported by older versions of Visual Studio. I changed the internal representation inside of the *_timespec_timepoint classes to a boost::intmax_t representing the number of nanoseconds since the epoch.
- Fixed some functions that wouldn't execute at all if they were provided a negative time duration or an absolute time that was in the past. From what I understand, they should instead execute once and then return immediately.
- Moved pthread/timespec.hpp to detail/timespec.hpp.
- Deleted detail/internal_clock.hpp and moved the seven relevant lines into detail/timespec.hpp. This keeps all of the internal clock declarations in one place.
- Renamed thread_detail::internal_clock_t to detail::internal_chrono_clock to be consistent with and yet clearly differentiated from detail::internal_timespec_clock.
- Removed "using namespace chrono" to eliminate ambiguious namespace resolution when referencing detail::internal_chrono_clock.
- Re-enabled a few tests on Windows that had previously been disabled. I want to see whether or not they still need to be disabled.
2017-09-28 22:27:37 -06:00
Austin Beer
c2b207faa4 Switching the Windows condition_variable and interruptible_wait functions over to using internal_timespec_clock. 2017-09-28 13:24:21 -06:00
Vicente J. Botet Escriba
776d42f6cb Merge branch 'develop' into feature/timespec_clocks 2017-09-26 08:01:28 +02:00
Vicente J. Botet Escriba
b20ea9ebb1 fix strike characted. 2017-09-26 08:00:44 +02:00
Vicente J. Botet Escriba
46c1ae6f96 Merge branch 'develop' into feature/timespec_clocks 2017-09-26 05:55:40 +02:00
Vicente J. Botet Escriba
f02f23eff5 Add STACK_SIZE_PARAM_IS_A_RESERVATION when setting the stack size. 2017-09-26 05:54:53 +02:00
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