Example #1
0
void CPPLIB( raise_exception )  // RAISE EXCEPTION
    ( FsExcRec* excrec )        // - exception record
{
    RW_DTREG* rw;
    THREAD_CTL *thr;            // - thread control
    thr = PgmThread();
    for( rw = thr->registered; ; rw = rw->base.prev ) {
        if( (*rw->base.handler)( excrec, rw, NULL, 0 ) != EXC_HAND_CONTINUE ) {
            break;
        }
    }
}
Example #2
0
void CPPLIB( unwind_global )    // GLOBAL UNWIND
    ( RW_DTREG* bound           // - bounding R/W entry
    , void (*)( void )          // - code address (ignored)
    , FsExcRec* excrec )        // - exception record
{
    RW_DTREG* rw;
    THREAD_CTL *thr;            // - thread control
    thr = PgmThread();
    excrec->flags |= EXC_TYPE_UNWIND_NORMAL;
    for( rw = thr->registered; rw != bound; rw = rw->base.prev ) {
        if( (*rw->base.handler)( excrec, rw, NULL, 0 ) != EXC_HAND_CONTINUE ) {
            break;
        }
    }
    excrec->flags &= ~EXC_TYPE_UNWIND_NORMAL;
}
Example #3
0
  _WPRTLINK
  void terminate( void )          // HANDLE TERMINATE
  {
    PFV handler;                // - NULL or handler set by "set_terminate"
    THREAD_CTL *thr;            // - thread ptr
    char* msg;                  // - error message

    thr = &_RWD_ThreadData;
    handler = thr->terminate;
    if( NULL == handler ) {
        thr = PgmThread();
        msg = thr->abort_msg;
        if( msg == NULL ) {
            __exit( 1 );
        }
    } else {
        (*handler)();
        msg = RTMSG_RET_TERMIN;
    }
    CPPLIB(fatal_runtime_error)( msg, 1 );
  }