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); }
// 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(); }
static void ReleaseLock(OTTCP *x, short oldLockout) { OTClearLock(&(x->o_readlock)); OTLeaveNotifier(x->o_tcp_ep); lockout_set(oldLockout); }