![](https://secure.gravatar.com/avatar/99fde0c1dfd216326aae0aff30d493f1.jpg?s=120&d=mm&r=g)
17 Mar
2010
17 Mar
'10
9:14 a.m.
On Wed, Mar 10, 2010 at 12:29 PM, Michael Widenius
wrote: We also use the thr_alarm() functionality when one uses 'kill connection-id' in MySQL. I don't know of any easy way to gracefully wake up a thread that is sleeping on SO_SNDTIMEO. Do you?
Well, I checked the code, and it seems to wake up the thread using pthread_kill(thread, signal) for the 'kill connection-id' command. This should work fine also when using SO_SNDTIMEO for timeouts on the socket. Just send the signal to the thread blocking on the socket with SO_SNDTIMEO, and the blocking socket call will return with EAGAIN or similar. - Kristian.