1 .\"
2 .\" Mach Operating System
3 .\" Copyright (c) 1993 Carnegie Mellon University
4 .\" All Rights Reserved.
5 .\"
6 .\" Permission to use, copy, modify and distribute this software and its
7 .\" documentation is hereby granted, provided that both the copyright
8 .\" notice and this permission notice appear in all copies of the
9 .\" software, derivative works or modified versions, and any portions
10 .\" thereof, and that both notices appear in supporting documentation.
11 .\"
12 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 .\"
16 .\" Carnegie Mellon requests users of this software to return to
17 .\"
18 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 .\" School of Computer Science
20 .\" Carnegie Mellon University
21 .\" Pittsburgh PA 15213-3890
22 .\"
23 .\" any improvements or extensions that they make and grant Carnegie Mellon
24 .\" the rights to redistribute these changes.
25 .\"
26 .\"
27 .\" HISTORY
28 .\" $Log: timer_sleep.man,v $
29 .\" Revision 2.2 93/12/07 14:01:35 dbg
30 .\" Created.
31 .\"
32 .\"
33 .TH timer_sleep 2 9/22/93
34 .CM 4
35 .SH NAME
36 .nf
37 timer_sleep \- sleep on a timer until a specified time
38 .SH SYNOPSIS
39 .nf
40 .ft B
41 #include <mach.h>
42
43 .nf
44 .ft B
45 kern_return_t
46 timer_sleep(
47 mach_timer_t timer,
48 time_spec_t expire_time,
49 int flags,
50 time_spec_t *wakeup_time); /* out */
51
52
53 .fi
54 .ft P
55 .SH ARGUMENTS
56 .TP 15
57 .B
58 timer
59 The timer on which the calling thread will sleep.
60 .TP 15
61 .B expire_time
62 The time at which the timer will expire, measured
63 against
64 .B timer's
65 clock.
66 .B flags
67 Options for the expiration time.
68 .TP 15
69 .B
70 wakeup_time
71 Returns the absolute time at which the thread was
72 awakened.
73
74
75 .SH DESCRIPTION
76 .B timer_sleep
77 makes the current thread sleep on a timer until
78 a given time. The expiration time is absolute, if
79 .B TIMER_ABSOLUTE
80 is set in
81 .B flags;
82 otherwise, the expiration time is relative to
83 the current time (of
84 .B timer's
85 clock).
86
87 When the timer expires, the thread is awakened,
88 and the absolute time at which it was awakened
89 is returned through
90 .B wakeup_time.
91 This will be the same as
92 .B expire_time,
93 unless the expiration time is relative or
94 the thread was prematurely awakened.
95
96 The thread may be awakened before the expiration
97 time is up by calling
98 .B thread_abort
99 on the thread, or by calling
100 .B timer_cancel
101 on the timer. The thread will also be awakened if
102 the timer is destroyed (by a call to
103 .B timer_terminate
104 or if all send rights to the timer's port have been
105 deallocated).
106
107
108 .SH DIAGNOSTICS
109 .TP 25
110 KERN_SUCCESS
111 Operation completed successfully
112 .TP 25
113 KERN_INVALID_ARGUMENT
114 .B timer
115 is not a timer, or
116 .B expire_time
117 is not a valid time specification.
118 .TP 25
119 KERN_FAILURE
120 .B timer
121 is currently armed.
122
123 .SH BUGS
124
125 .SH SEE ALSO
126 .B timer_create, timer_terminate, timer_arm, timer_cancel, thread_abort.
127
Cache object: b8a3a8236507ac3da2172281b0609ec3
|