[all-commits] [llvm/llvm-project] 85a8e5: [libc++] fix condition_variable_any hangs on stop_...

Hui via All-commits all-commits at lists.llvm.org
Sat Jan 20 13:18:56 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85a8e5c3e0586e85a2fa3ff9cef12455bd039921
      https://github.com/llvm/llvm-project/commit/85a8e5c3e0586e85a2fa3ff9cef12455bd039921
  Author: Hui <hui.xie1990 at gmail.com>
  Date:   2024-01-20 (Sat, 20 Jan 2024)

  Changed paths:
    M libcxx/include/condition_variable
    A libcxx/test/std/thread/thread.condition/thread.condition.condvarany/helpers.h
    M libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_for_token_pred.pass.cpp
    M libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_token_pred.pass.cpp
    M libcxx/test/std/thread/thread.condition/thread.condition.condvarany/wait_until_token_pred.pass.cpp

  Log Message:
  -----------
  [libc++] fix condition_variable_any hangs on stop_request (#77127)

When I implemented `condition_variable_any::wait`, I missed the most
important paragraph in the spec:

> The following wait functions will be notified when there is a stop
request on the passed stop_token.
> In that case the functions return immediately, returning false if the
predicate evaluates to false.

From
https://eel.is/c++draft/thread.condition#thread.condvarany.intwait-1.

Fixes #76807




More information about the All-commits mailing list