]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When suspending a thread if the timeout was very short or
authorMike Makonnen <mtm@FreeBSD.org>
Thu, 29 Jan 2004 09:44:36 +0000 (09:44 +0000)
committerMike Makonnen <mtm@FreeBSD.org>
Thu, 29 Jan 2004 09:44:36 +0000 (09:44 +0000)
commit98a11db62d676eed7710f4a06635d49092e00164
treead5b9b25ae6d1419d325b325932ee757d75c1cd6
parente6e9fb749a5821ecd443d2350b2c510465af2ed4
When suspending a thread if the timeout was very short or
the system call got interrupted and the absolute timeout is
converted to a relative timeout, it may happen that we get a
negative number. In such a case, simply set the timeout to
zero so that if the event that the thread wants to wait for has
happened it can still return successfully, but if it hasn't
happened then the thread doesn't suspend indefinitely. This should
fix certain applications (including mozilla) that seem to hang
indefinitely sometimes.

Noticed and debugged by: Morten Johansen <root@morten-johansen.net>
lib/libthr/thread/thr_kern.c