RE: [GD-Linux] Cancelling blocking recv calls on Linux
Brought to you by:
vexxed72
From: Hal A. <ha...@cl...> - 2002-05-10 14:08:52
|
I saw EINTR in the man pages - I couldn't figure out which signal to the thread though. I would send the signal by doing something like this: pthread_t threadId_; pthread_kill( threadId_, SIGKILL ); (Kill actually kills my entire process not just the target thread). Any ideas on the signal to use? -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Ryan C. Gordon Sent: 10 May 2002 14:49 To: gam...@li... Subject: Re: [GD-Linux] Cancelling blocking recv calls on Linux > Anybody got anything better or is this infact the correct way to use > blocking sockets with threads? Have you tried sending a signal to the blocked thread? When you do, recv() should return -1 and set errno to EINTR. From there the thread can check a global variable or something that symbolizes that the system is shutting down, and exit cleanly if it's set. --ryan. _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: ban...@so... _______________________________________________ Gamedevlists-linux mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-linux Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=554 |