mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-19 00:55:13 +08:00
34e9407b3b
This adds a non-standard extension to support initializing a std::jthread with a pointer to a member function that expects a stop_token to be added to the arguments. That use case is not supported by C++20, because the stop_token would get added as the first argument, which is where the object argument needs to be to invoke a pointer to member function. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/100612 * include/std/thread (__pmf_expects_stop_token): New variable template to detect a pointer to member function that needs a stop_token to be added to the arguments. (jthread::__S_create): Use __pmf_expects_stop_token. (jthread::__S_create_pmf): New function. * testsuite/30_threads/jthread/100612.cc: New test. |
||
---|---|---|
.. | ||
async | ||
barrier | ||
call_once | ||
condition_variable | ||
condition_variable_any | ||
future | ||
headers | ||
jthread | ||
latch | ||
lock | ||
lock_guard | ||
mutex | ||
packaged_task | ||
promise | ||
recursive_mutex | ||
recursive_timed_mutex | ||
scoped_lock | ||
semaphore | ||
shared_future | ||
shared_lock | ||
shared_mutex | ||
shared_timed_mutex | ||
stop_token | ||
this_thread | ||
thread | ||
timed_mutex | ||
try_lock | ||
unique_lock |