Posted by David on February 11, 2006 at 22:11:33:
In Reply to: Re: Interrupting a socket waiting on nlAcceptConnection() or nlRead()? posted by Phil Frisbie, Jr. on February 10, 2006 at 14:58:19:
: This issue has nothing to do with pthreads; it is a limitation of Berkeley sockets, and is well documented.
: Now, after I have said all this about "don't do it", I think that I can code around this problem inside HawkNL because the HawkNL sockets are NOT Berkeley sockets, but they do contain the Berkeley socket descriptor inside. I believe I can code nlClose() so that this problem is eliminated.
Well what would really be best is something so that thread2 can call
thread1.finished=true;
thread1.interrupt();
Then if the thread1 is blocked on nlRead() or nlAccept(), it would break out and close it's own socket.