Open somdoron opened 5 years ago
Can you provide an example using libzmq (rather than czmq)?
@sigiesec changed.
If using dealer instead of client the app do exit.
A solution might be, to provide a context function that signal all thread safe sockets. So a user can call it when interrupted. CZMQ will probably do it by default.
could the timed version be used instead? so that it can check for interruption
How can you check for interruption?
can't remember off the top of my head, but we are somehow doing it for the non-safe sockets right?
Also, it might make a performance problem, exiting and entering a mutex...
@bluca, no, the behavior of poll/select and pthread_cond_wait is different. poll get interrupted and return EINTR, pthread_cond_wait is not.
ah true, forgot about that
I guess then an API as you suggested is the easiest thing to get it working
Issue description
pthread_cond_wait is not being in interrupted by ctrl+c and I cannot stop an app that waits on a thread safe socket.
Environment
Minimal test code / Steps to reproduce the issue