diff options
author | David Leonard <d@cvs.openbsd.org> | 1999-06-09 07:16:18 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1999-06-09 07:16:18 +0000 |
commit | 5b25504c910ae952393636884728bb911ccd8733 (patch) | |
tree | 883d88f07de3449ef2ca038b75c007b57ce95e3d /lib/libpthread/uthread/uthread_nanosleep.c | |
parent | 26ab430a80ba9c64b06a358f6b69d491a912f54a (diff) |
document cancellation point handling a bit better
Diffstat (limited to 'lib/libpthread/uthread/uthread_nanosleep.c')
-rw-r--r-- | lib/libpthread/uthread/uthread_nanosleep.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libpthread/uthread/uthread_nanosleep.c b/lib/libpthread/uthread/uthread_nanosleep.c index 0f5c4c9c2ab..4e182adfb6c 100644 --- a/lib/libpthread/uthread/uthread_nanosleep.c +++ b/lib/libpthread/uthread/uthread_nanosleep.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: uthread_nanosleep.c,v 1.3 1999/01/17 23:57:27 d Exp $ + * $OpenBSD: uthread_nanosleep.c,v 1.4 1999/06/09 07:16:17 d Exp $ */ #include <stdio.h> #include <errno.h> @@ -48,7 +48,9 @@ nanosleep(const struct timespec * time_to_sleep, struct timespec remaining_time; struct timeval tv; + /* This is a cancellation point: */ _thread_enter_cancellation_point(); + /* Check if the time to sleep is legal: */ if (time_to_sleep == NULL || time_to_sleep->tv_nsec < 0 || time_to_sleep->tv_nsec > 1000000000 || time_to_sleep->tv_sec < 0) { /* Return an EINVAL error : */ @@ -96,7 +98,10 @@ nanosleep(const struct timespec * time_to_sleep, ret = -1; } } + + /* No longer in a cancellation point: */ _thread_leave_cancellation_point(); + return (ret); } #endif |