OpenAFS
OpenAFS distributed network file system
|
00001 /* 00002 * Copyright 2000, International Business Machines Corporation and others. 00003 * All Rights Reserved. 00004 * 00005 * This software has been released under the terms of the IBM Public 00006 * License. For details, see the LICENSE file in the top-level source 00007 * directory or online at http://www.openafs.org/dl/license10.html 00008 */ 00009 00010 /* Event package */ 00011 00012 #ifndef OPENAFS_RX_EVENT_H 00013 #define OPENAFS_RX_EVENT_H 00014 00015 /* This routine must be called to initialize the event package. 00016 * nEvents is the number of events to allocate in a batch whenever 00017 * more are needed. If this is 0, a default number (10) will be 00018 * allocated. */ 00019 extern void rxevent_Init( int nEvents, void (*scheduler)(void) ); 00020 00021 /* Arrange for the indicated event at the appointed time. when is a 00022 * "struct clock", in the clock.c time base */ 00023 struct clock; 00024 struct rxevent; 00025 extern struct rxevent *rxevent_Post(struct clock *when, struct clock *now, 00026 void (*func) (struct rxevent *, void *, 00027 void *, int), 00028 void *arg, void *arg1, int arg2); 00029 00030 /* Remove the indicated event from the event queue. The event must be 00031 * pending. Note that a currently executing event may not cancel itself. 00032 */ 00033 struct rx_call; 00034 extern void rxevent_Cancel(struct rxevent **, struct rx_call *, int type); 00035 00036 /* The actions specified for each event that has reached the current clock 00037 * time will be taken. The current time returned by GetTime is used 00038 * (warning: this may be an old time if the user has not called 00039 * clock_NewTime) 00040 */ 00041 extern int rxevent_RaiseEvents(struct clock *wait); 00042 00043 /* Acquire a reference to an event */ 00044 extern struct rxevent *rxevent_Get(struct rxevent *event); 00045 00046 /* Release a reference to an event */ 00047 extern void rxevent_Put(struct rxevent *event); 00048 00049 /* Shutdown the event package */ 00050 extern void shutdown_rxevent(void); 00051 00052 #endif /* _EVENT_ */