Example #1
0
void ProfileInvoke( char *name )
{
    unsigned    len;
#if defined(__UNIX__)
    handle      hndl;
#endif

    len = strlen( name );
    if( len != 0 ) {
        Invoke( name, len, NULL );
        return;
    }
    /* default name search */
    len = strlen( EXENAME );
    _AllocA( name, len + 4 );
#if defined(__UNIX__)
        /* under QNX and Linux, look for .wdrc first */
        name[0] = '.';
        strcpy( &name[1], EXENAME );
        strcat( name, "rc" );
        strlwr( name );
        hndl = LocalFullPathOpen( name, LIT( Empty ), TxtBuff, TXT_LEN );
        if( hndl != NIL_HANDLE ) {
            DoInvoke( hndl, TxtBuff, NULL );
            return;
        }
#endif
    strcpy( name, EXENAME );
    strlwr( name );
    Invoke( name, len, NULL );
}
Example #2
0
void Invoke( const char *invfile, int len, char_ring *parmlist )
{
    handle      hndl;

    hndl = LocalFullPathOpen( invfile, len, "dbg", TxtBuff, TXT_LEN );
    if( hndl == NIL_HANDLE ) {
        MakeFileName( TxtBuff, invfile, "dbg", 0 );
        FreeRing( parmlist );
        Error( ERR_NONE, LIT_ENG( ERR_FILE_NOT_OPEN ), TxtBuff );
    }
    DoInvoke( hndl, TxtBuff, parmlist );
}
Example #3
0
void Queue::Sync(Thunk thunk) {
    std::mutex m;
    std::condition_variable cv;
    std::unique_lock<std::mutex> l(m);
    bool done = false;
    DoInvoke([&] {
        std::unique_lock<std::mutex> l(m);
        thunk();
        done = true;
        cv.notify_all();
    });
    cv.wait(l, [&] { return done; });
}
Example #4
0
void Invoke( char *invfile, int len, char_ring *parmlist )
{
    char        *invname;
    handle      hndl;

    _AllocA( invname, len + 1 );
    memcpy( invname, invfile, len );
    invname[ len ] = '\0';
    hndl = LocalFullPathOpen( invname, "dbg", TxtBuff, TXT_LEN );
    if( hndl == NIL_HANDLE ) {
        MakeFileName( TxtBuff, invname, "dbg", 0 );
        FreeRing( parmlist );
        Error( ERR_NONE, LIT( ERR_FILE_NOT_OPEN ), TxtBuff );
    }
    DoInvoke( hndl, TxtBuff, parmlist );
}
Example #5
0
void Queue::Async(Thunk thunk) {
    DoInvoke(thunk);
}