When the producer thread calls the "flush" interface and returns false, then go to "notify"; When the consumer thread calls "checkunread" and returns "false", then go to "wait". However, the order of these two cannot be guaranteed in the implementation of ypipe_t. Because the order of operations for c cannot be guaranteed. It is possible to set "c" to "NULL" in the read thread. At this time, the read thread may fail to reach the "wait" due to scheduling or business time, and the "flush" interface may notify the CAS of the write thread too early. As the read thread has not yet reached the wait, it cannot be awakened. The subsequent flush interface will always return true.
Issue description
Consumer threads can never be awakened
Environment
linux,laster version;
Minimal test code / Steps to reproduce the issue
When the producer thread calls the "flush" interface and returns false, then go to "notify"; When the consumer thread calls "checkunread" and returns "false", then go to "wait". However, the order of these two cannot be guaranteed in the implementation of ypipe_t. Because the order of operations for c cannot be guaranteed. It is possible to set "c" to "NULL" in the read thread. At this time, the read thread may fail to reach the "wait" due to scheduling or business time, and the "flush" interface may notify the CAS of the write thread too early. As the read thread has not yet reached the wait, it cannot be awakened. The subsequent flush interface will always return true.