aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-11-15 23:44:47 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2019-11-15 23:44:47 +0000
commite73ca078b8d9de25593006ae573b48ae6b12576c (patch)
tree40a58633577e8773f091cf2c351fbaacc9b42cf9 /gcc
parentd5fbe5e014bc9fc803604eec805392c21ff4da16 (diff)
downloadgcc-e73ca078b8d9de25593006ae573b48ae6b12576c.zip
gcc-e73ca078b8d9de25593006ae573b48ae6b12576c.tar.gz
gcc-e73ca078b8d9de25593006ae573b48ae6b12576c.tar.bz2
libstdc++: Fix <stop_token> and improve tests
* include/std/stop_token: Reduce header dependencies by including internal headers. (stop_token::swap(stop_token&), swap(stop_token&, stop_token&)): Define. (operator!=(const stop_token&, const stop_token&)): Fix return value. (stop_token::_Stop_cb::_Stop_cb(Cb&&)): Use std::forward instead of (stop_token::_Stop_state_t) [_GLIBCXX_HAS_GTHREADS]: Use lock_guard instead of unique_lock. [!_GLIBCXX_HAS_GTHREADS]: Do not use mutex. (stop_token::stop_token(_Stop_state)): Change parameter to lvalue reference. (stop_source): Remove unnecessary using-declarations for names only used once. (swap(stop_source&, stop_source&)): Define. (stop_callback(const stop_token&, _Cb&&)) (stop_callback(stop_token&&, _Cb&&)): Replace lambdas with a named function. Use std::forward instead of std::move. Run callbacks if a stop request has already been made. (stop_source::_M_execute()): Remove. (stop_source::_S_execute(_Stop_cb*)): Define. * include/std/version (__cpp_lib_jthread): Define conditionally. * testsuite/30_threads/stop_token/stop_callback.cc: New test. * testsuite/30_threads/stop_token/stop_source.cc: New test. * testsuite/30_threads/stop_token/stop_token.cc: Enable test for immediate execution of callback. From-SVN: r278325
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions