[661] in Pthreads mailing list archive
[Q] Timeout a thread
daemon@ATHENA.MIT.EDU (monty@tcx.se)
Mon Jun 2 14:05:08 1997
Date: Mon, 2 Jun 1997 20:54:23 +0300 (EET DST)
From: <monty@tcx.se>
To: pthreads@MIT.EDU
In-Reply-To: <Pine.SOL.3.95.970602112739.7902A-100000@perot.snare.com>
Reply-To: monty@analytikerna.se
>>>>> "Chi" == Chi <chi@perot.snare.com> writes:
Chi> Hi folk,
Chi> I create a thread doing synchronous connect(). Is there any handy
Chi> thread functions to timeout/terminate if connect() takes too long?
Chi> Thanks in advance!
You can set up a alarm around the connect. It's a little tricky to do
this with threads, but you can look at the code in MySQL, mysys/thr_alarm.c
from http://www.tcx.se how to do this.
Monty