2 * Copyright 2000, International Business Machines Corporation and others.
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
12 #ifndef OPENAFS_RX_EVENT_H
13 #define OPENAFS_RX_EVENT_H
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
19 extern void rxevent_Init( int nEvents
, void (*scheduler
)(void) );
21 /* Arrange for the indicated event at the appointed time. when is a
22 * "struct clock", in the clock.c time base */
25 extern struct rxevent
*rxevent_Post(struct clock
*when
, struct clock
*now
,
26 void (*func
) (struct rxevent
*, void *,
28 void *arg
, void *arg1
, int arg2
);
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.
33 extern int rxevent_Cancel(struct rxevent
**);
35 /* The actions specified for each event that has reached the current clock
36 * time will be taken. The current time returned by GetTime is used
37 * (warning: this may be an old time if the user has not called
40 extern int rxevent_RaiseEvents(struct clock
*wait
);
42 /* Acquire a reference to an event */
43 extern struct rxevent
*rxevent_Get(struct rxevent
*event
);
45 /* Release a reference to an event */
46 extern void rxevent_Put(struct rxevent
**event
);
48 /* Shutdown the event package */
49 extern void shutdown_rxevent(void);