2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-22 05:42:37 +00:00
Commit Graph

1289 Commits

Author SHA1 Message Date
Vicente J. Botet Escriba
040481760c avoid defining twice BOOST_THREAD_WIN32. 2018-02-28 22:16:50 +01:00
Vicente J. Botet Escriba
e3358e0925 Merge branch 'develop' of github.com:boostorg/thread into develop 2018-02-26 16:23:41 +01:00
Vicente J. Botet Escriba
13a1f3daaa Merge pull request #211 from Lastique/rewrite_gettickcount64
Rewrite GetTickCount64 emulation implementation.
2018-02-26 16:22:54 +01:00
Vicente J. Botet Escriba
0871d0b0a6 Merge branch 'develop' of github.com:boostorg/thread into develop 2018-02-21 02:13:26 +01: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
03acfa57a2 Merge branch 'master' into develop 2018-02-20 18:04:56 +01:00
Vicente J. Botet Escriba
9be0996062 merge develop (timespec_clocks). 2018-02-20 17:52:51 +01:00
Austin Beer
71231fb2ae Remove unnecessary inline keyword from templated functions 2018-02-16 11:38:45 -07:00
Vicente J. Botet Escriba
ff5031db9e Merge branch 'develop' into feature/timespec_clocks 2018-02-14 19:05:50 +01:00
Austin Beer
96484ac57f Replace hard-coded poll interval with BOOST_THREAD_POLL_INTERVAL_MILLISECONDS 2018-02-12 16:52:22 -07:00
Austin Beer
3b7ca04408 Improve when and where the inline keyword is used. 2018-02-12 13:54:50 -07:00
Vicente J. Botet Escriba
473648ce6c fix ODR issue when future continuations are enabled. #193 future_then unit test contains two different implementations of do_continuation function. 2018-02-10 14:12:25 +01:00
Vicente J. Botet Escriba
426636b1d0 Merge pull request #204 from shinobu-x/wip-future-0002
Missing destructor
2018-02-03 09:26:55 +01:00
Shinobu Kinjo
cb322cfa86 Missing destructor 2018-02-02 17:38:27 +09:00
Vicente J. Botet Escriba
f855cb31d1 merge from develop with some winapp merge issues. 2018-01-28 14:37:53 +01:00
Shinobu Kinjo
f83e887d53 Not *_FUNTION_* but *_FUNCTION_* 2018-01-26 10:03:16 +09:00
Shinobu Kinjo
072bbee63e future.hpp:
1) Removed redundant access specifiers and unused variables in future_deferred_shared_state
2) check lock before unlock
2018-01-23 04:58:13 +09:00
Nikita Kniazev
7ab14ac4a3 future.hpp: Fixed name shadowing 2017-12-24 03:28:43 +03:00
Austin Beer
610c3ae071 Fix issues with v2/shared_mutex.hpp
* Fixed try_unlock_shared_and_lock_until/for() and
  try_unlock_shared_and_lock_upgrade_until/for() so that they wait on the
  correct condition variable for the associated predicate.
* Fixed try_unlock_shared_and_lock_until/for() and
  try_unlock_upgrade_and_lock_until/for() so that they take the
  write_entered_ flag before waiting for all shared readers to unlock. This
  prevents new readers from taking a shared lock or new writers from taking
  the exclusive lock while these functions are waiting to take the
  exclusive lock.
* Changed notify_all() calls to occur while the mutex is being held to be
  consistent with the notify_one() calls and the existing
  pthread/shared_mutex.hpp implementation.
* Added BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS ifdefs.
* Added BOOST_ASSERT() statements to verify correct usage and operation.
* Fixed an incorrect test case that the BOOST_ASSERT() statements
  uncovered.
* Added comments to explain certain design decisions.
2017-12-20 12:26:09 -07:00
Austin Beer
b2903a5d14 Fix v2/shared_mutex.hpp time jump issues 2017-12-20 12:14:59 -07:00
Austin Beer
81f3a78b8a Rearrange v2/shared_mutex.hpp so related functions appear together
* Added checks for BOOST_THREAD_USES_CHRONO
* Rearranged the order of the functions in v2/shared_mutex.hpp
* No changes were made to the contents of any functions
2017-12-19 14:14:17 -07:00
Austin Beer
e5224ee27a Fix win32 shared_mutex time jump issues 2017-12-19 09:42:54 -07:00
Austin Beer
d77affc6f5 Fix win32 mutex and recursive_mutex time jump issues
* Also added comments to the win32 mutex implementations to clarify
  how the existing code works
* Also removed a few unnecessary intermediate variables
2017-12-19 09:42:46 -07:00
Austin Beer
e96516d10d Fix sync queue time jump issues
* Used the predicate version of condition_variable::wait_until() which
  correctly handles time jump events.

* Fixed an issue with sync_timed_queue::pull_until()/pull_for() where
  they could incorrectly return queue_op_status::timeout instead of
  queue_op_status::success.

* Changed sync_timed_queue::wait_pull() to return
  queue_op_status::success instead of queue_op_status::closed when the
  queue has been closed but an item is available and is ready to be
  pulled off the queue.

* Changed sync_priority_queue::pull_until()/pull_for() and
  sync_timed_queue::pull_until()/pull_for() to return
  queue_op_status::closed instead of throwing an exception when the
  queue is closed since they have a queue_op_status return type.
2017-11-07 21:14:35 -07:00
Austin Beer
907e827046 Add support for BOOST_THREAD_V2_SHARED_MUTEX
BOOST_THREAD_V2_SHARED_MUTEX allows users to use v2/shared_mutex.hpp
instead of pthread/shared_mutex.hpp or win32/shared_mutex.hpp.
2017-11-07 16:48:59 -07:00
Aleksey Katargin
609d1a7be0 allow sync policy for future then continuation (fix #111) 2017-11-01 11:40:50 +03:00
Austin Beer
1e84b978b2 Use CLOCK_MONOTONIC by default
- Eliminated BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC.
- CLOCK_MONOTONIC is now always used whenever it is available.
2017-10-26 08:07:49 -06:00
Austin Beer
2de04292da Rename CD to common_duration to match Boost Chrono
See https://github.com/boostorg/chrono/pull/23
2017-10-26 07:54:04 -06:00
Austin Beer
c50428f612 Use direct initialization instead of assignment 2017-10-26 07:53:49 -06:00
Austin Beer
b4348b3cff Clean up detail/thread.hpp so all of the chrono functions are together 2017-10-26 07:53:37 -06:00
Austin Beer
fea3e33128 Remove empty v2/thread.hpp file 2017-10-26 07:53:24 -06:00
Austin Beer
d60a11a75b Delete unused file: pthread/shared_mutex_assert.hpp 2017-10-26 07:53:15 -06:00
Austin Beer
cfd93c7747 Correct a fix that I previously implemented incorrectly 2017-10-26 07:52:42 -06:00
Andrey Semashev
343230cd78 Updated Boost.WinAPI usage to the new location and namespace. 2017-10-25 01:09:24 +03:00
Vicente J. Botet Escriba
6d7bc558d0 Implement mono_platform_clock and mono_platform_timepoint fro MacOs. 2017-10-23 22:40:49 +02:00
Vicente J. Botet Escriba
d345533596 move files from boost/detail to boost/thread/detail. 2017-10-19 18:14:37 +02:00
Vicente J. Botet Escriba
6ddf6a8acf Merge pull request #180 from austin-beer/feature/timespec_clocks_pr19_no_int_sleep_on_win
Add and fix sleep functions
2017-10-15 18:27:19 +02: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
eef7293932 Updated pthread/shared_mutex and future to use predicate wait functions.
- This allowed these classes to take advantage of the time jump fixes in condition_variable.
Fixed a minor issue where, if a thread was waiting after calling one of the following functions and it timed out at the same time it was given the lock, it would return false (failure) rather than succeeding.
- mutex::timed_lock()
- mutex::try_lock_for()
- mutex::try_lock_until()
- recursive_mutex::timed_lock()
- recursive_mutex::try_lock_for()
- recursive_mutex::try_lock_until()
- shared_mutex::timed_lock_shared()
- shared_mutex::try_lock_shared_for()
- shared_mutex::try_lock_shared_until()
2017-10-13 11:47:46 -06:00
Austin Beer
b65b2f3fea Reverted future.hpp and pthread/shared_mutex.hpp back to the versions in the develop branch. This discarded all changes made to these two files in the feature/timespec_clocks branch to date. 2017-10-13 11:47:46 -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
Vicente J. Botet Escriba
3b5d0c8d7f fix meger issues from develop. Disable notification_lost test as need to be fixed for macos. 2017-10-11 09:32:19 +02:00
Vicente J. Botet Escriba
517f1efc56 replace check by unlock_if_locked as some OsX define a check macro. 2017-10-04 23:33:48 +02:00
Austin Beer
82e2c82e95 Renaming timespec to platform 2017-10-02 09:23:54 -06:00
Vicente J. Botet Escriba
178e0661ab fix bad clock:: use, shoudl be chrono::steady_clock. 2017-10-02 08:59:41 +02:00
Vicente J. Botet Escriba
9f7e37c892 Merge branch 'develop' into feature/timespec_clocks 2017-10-01 13:28:57 +02:00
Vicente J. Botet Escriba
995033cf20 Make sync_timed_queue more general adding a TimePoint parameter and fix the inteface of all the time related functions _for/_until to take generic chrono::timepoints and chrono::durations. 2017-09-30 12:15:06 +02:00
Austin Beer
659d309206 Re-enabled tests on Windows that had been temporarily disabled. 2017-09-29 15:53:21 -06:00
Austin Beer
847dcbf237 Removed unnecessary explicit qualifiers. 2017-09-29 15:28:04 -06:00
Austin Beer
35d25851ce * Reverted some of my Windows updates to get a condition variable test on Windows to pass again. Further analysis is needed to determine why the updates didn't work.
* Increased the range of one test so it passes on Windows.
2017-09-29 14:52:42 -06:00