return now.tv_sec;
}
-void
-afs_osi_SetTime(osi_timeval_t * atv)
-{
- printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
-}
-
/* cancel osi_Wait */
void
afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle)
return code;
}
+afs_event_t *afs_evhasht[AFS_EVHASHSIZE]; /* Hash table for events */
+#define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (AFS_EVHASHSIZE-1))
+int afs_evhashcnt = 0;
+
+/* Get and initialize event structure corresponding to lwp event (i.e. address)
+ * */
+static afs_event_t *
+afs_getevent(char *event)
+{
+ afs_event_t *evp, *newp = 0;
+ int hashcode;
+
+ AFS_ASSERT_GLOCK();
+ hashcode = afs_evhash(event);
+ evp = afs_evhasht[hashcode];
+ while (evp) {
+ if (evp->event == event) {
+ evp->refcount++;
+ return evp;
+ }
+ if (evp->refcount == 0)
+ newp = evp;
+ evp = evp->next;
+ }
+ if (!newp) {
+ newp = osi_AllocSmallSpace(sizeof(afs_event_t));
+ afs_evhashcnt++;
+ newp->next = afs_evhasht[hashcode];
+ afs_evhasht[hashcode] = newp;
+ newp->seq = 0;
+ }
+ newp->event = event;
+ newp->refcount = 1;
+ return newp;
+}
+
+/* Release the specified event */
+#define relevent(evp) ((evp)->refcount--)
+
int
afs_osi_TimedSleep(void *event, afs_int32 ams, int aintok)
{