You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an assumption that at any time, there is either 1 or 0 bytes in the pipe.
This assumption breaks if 2 threads call set, each checks the flags, sees that it's false, sets it to true and writes a byte to the pipe. After that - if we call clear, it will only read 1 of the bytes, so the flag will be false but the fd will still be readable, a wait will return immediately without actually waiting for a set in that case.