예제 #1
0
파일: otudp.c 프로젝트: CNMAT/CNMAT-Externs
static void ReleaseLock(OTUDP *x, short oldLockout) {
	if (x->o_semaphoreTest != 1) {
		error("¥ otudp_read: about to release lock, but semaphoreTest is %ld", x->o_semaphoreTest);
	}
	--(x->o_semaphoreTest);

	OTClearLock(&(x->o_readlock));
	OTLeaveNotifier(x->o_udp_ep);
	lockout_set(oldLockout);
}
예제 #2
0
// This function is taken from GUSI interface.
// ( 01/02/19 masahiro minami<*****@*****.**> )
static void AsyncTCPPopEvent( TCPsocket sock )
{
	// Make sure OT calls are not interrupted
	// Not sure if we really need this.
	OTEnterNotifier( sock->channel );
	
	sock->event |= (sock->curEvent = sock->newEvent );
	sock->completion |= ( sock->curCompletion = sock->newCompletion );
	sock->newEvent = sock->newCompletion = 0;
	
	OTLeaveNotifier( sock->channel );
	
	if( sock->curEvent & T_UDERR)
	{
		// We just clear the error.
		// Should we feed this back to users ?
		// (TODO )
		OTRcvUDErr( sock->channel, NULL );
		
#ifdef DEBUG_NET
		printf("AsyncTCPPopEvent  T_UDERR recognized");
#endif
	}
	
	// Remote is disconnecting...
	if( sock->curEvent & ( T_DISCONNECT | T_ORDREL ))
	{
		sock->readShutdown = true;
	}
	
	if( sock->curEvent &T_CONNECT )
	{
		// Ignore the info of remote (second parameter).
		// Shoule we care ?
		// (TODO)
		OTRcvConnect( sock->channel, NULL );
		sock->connected = 1;
	}
	
	if( sock->curEvent & T_ORDREL )
	{
		OTRcvOrderlyDisconnect( sock->channel );
	}
	
	if( sock->curEvent & T_DISCONNECT )
	{
		OTRcvDisconnect( sock->channel, NULL );
	}
	
	// Do we need to ?
	// (masahiro minami<*****@*****.**>)
	//YieldToAnyThread();
}
예제 #3
0
파일: ottcp.c 프로젝트: CNMAT/CNMAT-Externs
static void ReleaseLock(OTTCP *x, short oldLockout) {
	OTClearLock(&(x->o_readlock));
	OTLeaveNotifier(x->o_tcp_ep);
	lockout_set(oldLockout);
}