Am I forced to use pthread_cond_broadcast (over pthread_cond_signal) in order to guarantee that *my* thread is woken up?

后端 未结 2 878
误落风尘
误落风尘 2021-01-04 21:55

In the context of interfacing some QT GUI thread (a pthread thread) with some C code, I stumbled over the following problem: I launch the QT Gui thread and, before my C thre

2条回答
  •  迷失自我
    2021-01-04 22:32

    Yes, if you require a specific thread to be woken up then you either need to broadcast the wakeup, or use a separate condition variable for that thread.

提交回复
热议问题