History log of /libuv/src/thread-common.c (Results 1 – 1 of 1)
Revision Date Author Comments
# 964f79f7 06-Mar-2023 Jameson Nash

barrier: wait for prior out before next in (#3905)

This code would previously get confused between rounds of the barrier
being called and a thread might incorrectly get stuck (deadlock)

barrier: wait for prior out before next in (#3905)

This code would previously get confused between rounds of the barrier
being called and a thread might incorrectly get stuck (deadlock) if the
next round started before that thread had exited the current round.

Avoid that by not starting the next round in++ before out-- has reached
zero indicating that all threads have left the prior round.

And fix it that on Windows by replacing the implementation with the one
from unix. There are some awkward platform-specific redirection here
with an extra malloc that is not needed on Win32, but that will be fixed
in libuv v2.

Fixes: https://github.com/libuv/libuv/issue/3872

show more ...