rx: Don't adjust non-existent events
[openafs.git] / src / rx / rx_event.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /* Event package */
11
12 #ifndef OPENAFS_RX_EVENT_H
13 #define OPENAFS_RX_EVENT_H
14
15 /* This routine must be called to initialize the event package.
16  * nEvents is the number of events to allocate in a batch whenever
17  * more are needed.  If this is 0, a default number (10) will be
18  * allocated. */
19 extern void rxevent_Init( int nEvents, void (*scheduler)(void) );
20
21 /* Arrange for the indicated event at the appointed time.  when is a
22  * "struct clock", in the clock.c time base */
23 struct clock;
24 struct rxevent;
25 extern struct rxevent *rxevent_Post(struct clock *when, struct clock *now,
26                                     void (*func) (struct rxevent *, void *,
27                                                   void *, int),
28                                     void *arg, void *arg1, int arg2);
29
30 /* Remove the indicated event from the event queue.  The event must be
31  * pending.  Note that a currently executing event may not cancel itself.
32  */
33 struct rx_call;
34 extern void rxevent_Cancel(struct rxevent **, struct rx_call *, int type);
35
36 /* The actions specified for each event that has reached the current clock
37  * time will be taken.  The current time returned by GetTime is used
38  * (warning:  this may be an old time if the user has not called
39  * clock_NewTime)
40  */
41 extern int rxevent_RaiseEvents(struct clock *wait);
42
43 /* Acquire a reference to an event */
44 extern struct rxevent *rxevent_Get(struct rxevent *event);
45
46 /* Release a reference to an event */
47 extern void rxevent_Put(struct rxevent *event);
48
49 /* Shutdown the event package */
50 extern void shutdown_rxevent(void);
51
52 #endif /* _EVENT_ */