static int query(const char *domain, int type, int flags, cell_db_entry *dbservers, int max_num, int *ret_num, int *lowest_ttl) { struct ko_dns_query q; q.domain = domain; q.flags = flags & (CELL_QUERY|HOST_QUERY); q.dbservers = dbservers; q.max_num = max_num; if (type & CELL_QUERY) q.dbnum = 0; else q.dbnum = max_num; if (lowest_ttl) q.lowest_ttl = *lowest_ttl; IOMGR_Cancel(ares_pid); ares_query(achannel, domain, C_IN, type, callback, &q); while((q.flags & QUERY_DONE) == 0) LWP_WaitProcess(&q); if (lowest_ttl) *lowest_ttl = q.lowest_ttl; if (ret_num) *ret_num = q.dbnum; return q.error; }
int fsprobe_ForceProbeNow(void) { /*fsprobe_ForceProbeNow */ static char rn[] = "fsprobe_ForceProbeNow"; /*Routine name */ /* * There isn't a prayer unless we've been initialized. */ if (!fsprobe_initflag) { fprintf(stderr, "[%s] Must call fsprobe_Init first!\n", rn); return (-1); } /* * Kick the sucker in the side. */ IOMGR_Cancel(probeLWP_ID); /* * We did it, so report the happy news. */ return (0); } /*fsprobe_ForceProbeNow */
/* Called by IOMGR at low priority on IOMGR's stack shortly after a SIGCHLD * occurs. Wakes up bproc do redo things */ void * bnode_SoftInt(void *param) { /* int asignal = (int) param; */ IOMGR_Cancel(bproc_pid); return 0; }
static void freeEnterprise(void *foo) { PROCESS *pid = (PROCESS *) foo; while(1) { IOMGR_Sleep(1); printf("[enterpri] Raise salery\n"); IOMGR_Cancel(*pid); } }
/* function called to set / clear periodic bnode wakeup times */ int bnode_SetTimeout(struct bnode *abnode, afs_int32 atimeout) { if (atimeout != 0) { abnode->nextTimeout = FT_ApproxTime() + atimeout; abnode->flags |= BNODE_NEEDTIMEOUT; abnode->period = atimeout; IOMGR_Cancel(bproc_pid); } else { abnode->flags &= ~BNODE_NEEDTIMEOUT; } return 0; }
/* This routine will get called by the event package whenever a new, earlier than others, event is posted. If the Listener process is blocked in selects, this will unblock it. It also can be called to force a new trip through the rxi_Listener select loop when the set of file descriptors it should be listening to changes... */ void rxi_ReScheduleEvents(void) { if (rx_listenerPid) IOMGR_Cancel(rx_listenerPid); }