Esempio n. 1
0
	wxSemaError TryWait() 
	{ 
	    wxSemaError err = WaitTimeout(kDurationImmediate); 
	    if ( err == wxSEMA_TIMEOUT )
	        err = wxSEMA_BUSY ;
	    return err ;
	}
Esempio n. 2
0
bool RemoteConnect( void )
{
    PostListens();
#ifdef SERVER
    if( !Listening ) {
        _INITSPXECB( Conn, 1, 0, 0 );
        _SPXListenForConnection( 0, 0, &ConnECB );
        Listening = 1;
    } else if( ConnECB.inUseFlag == 0 ) {
        if( ConnECB.completionCode == 0 ) {
            Connection = ConnECB.SPXConnectionID;
            return( true );
        }
    }
    _IPXRelinquishControl();
#else
    _INITECB( SendECB, SendHead, 1, SPX );
    if( _SPXEstablishConnection( 0, 0, &Connection, &SendECB ) == 0 ) {
        if( WaitTimeout( &SendECB, MAX_CONNECT_WAIT, 0 ) ) {
            return( true );
        } else {
            _SPXAbortConnection( Connection );
        }
    }
#endif
    return( false );
}
Esempio n. 3
0
    wxSemaError TryWait()
    {
        wxSemaError rc = WaitTimeout(0);
        if ( rc == wxSEMA_TIMEOUT )
            rc = wxSEMA_BUSY;

        return rc;
    }
void DefaultMessagePump::Run(Delegate* delegate)
{
	// Quit must have been called outside of Run!
	assert(should_quit_ == false);

	for (;;)
	{
		bool did_work = delegate->DoWork();
		if (should_quit_)
			break;

		did_work |= delegate->DoDelayedWork(&delayed_work_time_);
		if (should_quit_)
			break;

		if (did_work)
			continue;

		did_work = delegate->DoIdleWork();
		if (should_quit_)
			break;

		if (did_work)
			continue;

		if (delayed_work_time_.is_null())
		{
			Wait();
		}
		else
		{
			TimeDelta delay = delayed_work_time_ - TimeTicks::Now();
			if (delay > TimeDelta())
				WaitTimeout(delay);
			else
			{
				// It looks like delayed_work_time_ indicates a time in the past, so we
				// need to call DoDelayedWork now.
				delayed_work_time_ = TimeTicks();
			}
		}
	}

	should_quit_ = false;
}
Esempio n. 5
0
 wxSemaError Wait() { return WaitTimeout(INFINITE); }
Esempio n. 6
0
 wxSemaError Wait()
 { return WaitTimeout( kDurationForever); }
bool WaitableEvent::Wait()
{
	return WaitTimeout(TimeDelta::FromSeconds(-1));
}
Esempio n. 8
0
 wxCondError Wait()
 {
     return WaitTimeout(0xFFFFFFFF );
 }
Esempio n. 9
0
 wxSemaError TryWait() { return WaitTimeout(0); }
Esempio n. 10
0
 wxSemaError TryWait() { return WaitTimeout(SEM_IMMEDIATE_RETURN); }
Esempio n. 11
0
 wxSemaError Wait() { return WaitTimeout(SEM_INDEFINITE_WAIT); }
Esempio n. 12
0
 wxCondError Wait()
 {
     return WaitTimeout( kDurationForever );
 }
Esempio n. 13
0
static char FindPartner( void )
{
    static char RepBuff[132];

#ifdef __WINDOWS__
    {
        BYTE    moresegments;
        BYTE    propertyflags;
        int         binderyerror;

        binderyerror = NWReadPropertyValue( 0,
                                         SAPHead.name,
                                         DBG_SERVER_TYPE,
//                                       _SWAPINT( DBG_SERVER_TYPE ),
                                         "NET_ADDRESS",
                                         1,
                                         RepBuff,
                                         (void *)&moresegments,
                                         (void *)&propertyflags );
        if( binderyerror != 0 ) return( 0 );
        AssignArray( ServHead.destination, RepBuff[0] );
    }
#else
    {
        extern char ReadPropertyValue( void *, void *);

        #pragma aux ReadPropertyValue =         \
        0xb4 0xe3                       /* mov ah,0e3h */       \
        0x1e                            /* push ds */           \
        0x07                            /* pop es */            \
        0xcd 0x21                       /* int 21h */           \
        parm [ si ] [ di ] value [al] modify [ es ];

        static char ReqBuff[80];
        unsigned    i;

        ReqBuff[ 2 ] = 0x3d; /* sub-function */
        ACC_WORD( ReqBuff[ 3 ] ) = DBG_SERVER_TYPE;
        i = strlen( SAPHead.name );
        ReqBuff[5] = i;
        memcpy( &ReqBuff[6], &SAPHead.name, i );
        i += 6;
        ReqBuff[ i++ ] = 1;
        ReqBuff[ i++ ] = sizeof( "NET_ADDRESS" ) - 1;
        memcpy( &ReqBuff[ i ], "NET_ADDRESS", sizeof( "NET_ADDRESS" ) - 1 );
        ACC_WORD( ReqBuff[0] ) = i + (sizeof( "NET_ADDRESS" ) - 2);
        ACC_WORD( RepBuff[0] ) = 130;
putstring( "read prop\r\n" );
        if( ReadPropertyValue( &ReqBuff, &RepBuff ) != 0 ) return( 0 );
putstring( "assgn array\r\n" );
        AssignArray( ServHead.destination, RepBuff[2] );
    }
#endif
putstring( "lcl targ\r\n" );
    if( _IPXGetLocalTarget( &ServHead.destination.network.a[0],
                           &ServECB.immediateAddress.a[0],
                            (WORD *)&RepBuff ) != 0 ) return( 0 );
    RespECB.fragmentDescriptor[1].address = &PartnerSPXSocket;
    _IPXListenForPacket( &RespECB );
putstring( "send p\r\n" );
    _IPXSendPacket( &ServECB );
    WaitOn( ServECB );
putstring( "wait for\r\n" );
    if( !WaitTimeout( &RespECB, MAX_PARTNER_WAIT, 1 ) ) return( 0 );
putstring( "got one\r\n" );
    SendHead.destination = RespHead.source;
    SendHead.destination.socket = PartnerSPXSocket;
    SendECB.immediateAddress = RespECB.immediateAddress;
    return( 1 );
}