diff options
author | deischen <deischen@FreeBSD.org> | 2000-11-09 05:00:06 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2000-11-09 05:00:06 +0000 |
commit | 070083863e1a42a29bc6f43a098fa06e067e4363 (patch) | |
tree | 140e22c41b1646a7c65e68a5d8610f5300cfac52 /lib/libc_r/uthread | |
parent | de869208f6c8f82aec9e4a20cd2d68557e3a779e (diff) | |
download | FreeBSD-src-070083863e1a42a29bc6f43a098fa06e067e4363.zip FreeBSD-src-070083863e1a42a29bc6f43a098fa06e067e4363.tar.gz |
Prevent the thread-safe version of kevent from getting
into an infinite loop when a timeout value is supplied
and the timeout expires.
Reported by: Dan Nelson <dnelson@emsphone.com>
Reviewed by: jasone, jlemon
Diffstat (limited to 'lib/libc_r/uthread')
-rw-r--r-- | lib/libc_r/uthread/uthread_kevent.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc_r/uthread/uthread_kevent.c b/lib/libc_r/uthread/uthread_kevent.c index 796c12c..290094d 100644 --- a/lib/libc_r/uthread/uthread_kevent.c +++ b/lib/libc_r/uthread/uthread_kevent.c @@ -55,8 +55,9 @@ kevent(int kq, const struct kevent *changelist, int nchanges, _thread_run->data.fd.branch = __LINE__; do { - /* Reset the interrupted operation flag: */ + /* Reset the interrupted and timeout flags: */ _thread_run->interrupted = 0; + _thread_run->timeout = 0; _thread_kern_sched_state(PS_FDR_WAIT, __FILE__, __LINE__); @@ -68,7 +69,7 @@ kevent(int kq, const struct kevent *changelist, int nchanges, } rc = _thread_sys_kevent(kq, NULL, 0, eventlist, nevents, &nullts); - } while (rc == 0 && timeout != NULL); + } while (rc == 0 && _thread_run->timeout == 0); } return (rc); } |