if (pid != getpid())
LEAVE_CRITICAL(); if (pid != mypid)
tick(sig)	int sig;{	register time_t now;	register EVENT *ev;	int mypid = getpid();	int save_errno = errno;	(void) alarm(0);	now = curtime();	if (tTd(5, 4))		dprintf("tick: now=%ld\n", (long) now);	/* reset signal in case System V semantics */	(void) setsignal(SIGALRM, tick);	while ((ev = EventQueue) != NULL &&	       (ev->ev_time <= now || ev->ev_pid != mypid))	{		void (*f)();		int arg;		int pid;		/* process the event on the top of the queue */		ev = EventQueue;		EventQueue = EventQueue->ev_link;		if (tTd(5, 6))			dprintf("tick: ev=%lx, func=%lx, arg=%d, pid=%d\n",				(u_long) ev, (u_long) ev->ev_func,				ev->ev_arg, ev->ev_pid);		/* we must be careful in here because ev_func may not return */		f = ev->ev_func;		arg = ev->ev_arg;		pid = ev->ev_pid;		ev->ev_link = FreeEventList;		FreeEventList = ev;		if (pid != getpid())			continue;		if (EventQueue != NULL)		{			if (EventQueue->ev_time > now)				(void) alarm((unsigned) (EventQueue->ev_time - now));			else				(void) alarm(3);		}		/* call ev_func */		errno = save_errno;		(*f)(arg);		(void) alarm(0);		now = curtime();	}	if (EventQueue != NULL)		(void) alarm((unsigned) (EventQueue->ev_time - now));	errno = save_errno;	return SIGFUNC_RETURN;}