Index: libcxx/include/semaphore =================================================================== --- libcxx/include/semaphore +++ libcxx/include/semaphore @@ -87,10 +87,9 @@ { if(0 < __a.fetch_add(__update, memory_order_release)) ; - else if(__update > 1) - __a.notify_all(); else - __a.notify_one(); + // Always notify all, regardless of the value of __update (see PR47013) + __a.notify_all(); } _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void acquire()