#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* afs statistics */
-
-
-static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
-
static char waitV;
-
void
afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle)
{
do {
AFS_ASSERT_GLOCK();
code = 0;
- code = osi_TimedSleep(&waitV, ams, aintok);
+ code = afs_osi_TimedSleep(&waitV, ams, aintok);
if (code)
break; /* if something happened, quit now */
-typedef struct afs_event {
- struct afs_event *next; /* next in hash chain */
- char *event; /* lwp event: an address */
- int refcount; /* Is it in use? */
- int seq; /* Sequence number: this is incremented
- * by wakeup calls; wait will not return until
- * it changes */
- kcondvar_t cond; /* Currently associated condition variable */
-} afs_event_t;
-
-#define HASHSIZE 128
-afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */
+afs_event_t *afs_evhasht[AFS_EVHASHSIZE]; /* Hash table for events */
#if (_MIPS_SZPTR == 64)
-#define afs_evhash(event) (afs_uint32) ((((long)event)>>3) & (HASHSIZE-1));
+#define afs_evhash(event) (afs_uint32) ((((long)event)>>3) & (AFS_EVHASHSIZE-1));
#else
-#define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1));
+#define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (AFS_EVHASHSIZE-1));
#endif
int afs_evhashcnt = 0;
return 0;
}
-/* osi_TimedSleep
+/* afs_osi_TimedSleep
*
* Arguments:
* event - event to sleep on
*
* Returns 0 if timeout and EINTR if signalled.
*/
-static int
-osi_TimedSleep(char *event, afs_int32 ams, int aintok)
+int
+afs_osi_TimedSleep(void *event, afs_int32 ams, int aintok)
{
int code = 0;
struct afs_event *evp;
ticks.tv_sec = ams / 1000;
ticks.tv_nsec = (ams - (ticks.tv_sec * 1000)) * 1000000;
-
evp = afs_getevent(event);
AFS_ASSERT_GLOCK();