C++ pthread blocking queue deadlock (I think)

后端 未结 3 1970
情书的邮戳
情书的邮戳 2020-12-15 13:09

I am having a problem with pthreads where i think i am getting a deadlock. I have created a blocking queue which I thought was working, but after doing some more testing I h

3条回答
  •  情歌与酒
    2020-12-15 13:23

    I'm not exactly familiar with pthread_cancel() - I prefer cooperative termination.

    Wouldn't a pthread_cancel() leave your mutex locked? I suppose you need to cleanup with a cancellation handler.

提交回复
热议问题