Skip to content

Conversation

@krsfrodaslz
Copy link
Contributor

在 producer 将 done 赋值为 true 之前,如果 consumer 已经处理完最后一个数据并再次进入了等待,那么即使被唤醒,也无法跳出检查条件变量 notified 的循环。

@krsfrodaslz
Copy link
Contributor Author

另外, done 也是多个线程共享的数据,不用互斥锁保护起来是不对的。

@changkun changkun merged commit ec3e0e6 into changkun:master Apr 18, 2018
@changkun
Copy link
Owner

Thanks!

@changkun changkun added the typo label May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants