Show
Ignore:
Timestamp:
07/07/07 04:41:31 (17 months ago)
Author:
krobillard
Message:

Setting words in the shared global store now throws an error.
Default binding changed so top-level set-words are added to thread context.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/urlan.c

    r426 r427  
    4040   The global context is fixed so it can be shared by all UrlanEnv instances. 
    4141*/ 
    42 UCellContext ur_global = 
     42UCellContext ur_thrGlobal = 
    4343{ 
    4444    UT_CONTEXT, 0, 0, 
     
    209209    dtBlk = ur_blockPtr( blkN ); 
    210210 
    211     i = ur_internWord( (UCell*) &ur_global, ur_intern( "datatypes", 9 ) ); 
     211    i = ur_internWord( (UCell*) &ur_thrGlobal, ur_intern( "datatypes", 9 ) ); 
    212212    cell = vblk->ptr.cells + i; 
    213213    ur_initBlock( cell, blkN, 0 ); 
     
    222222 
    223223    /* Add 'none */ 
    224     i = ur_internWord( (UCell*) &ur_global, ur_intern( "none", 4 ) ); 
     224    i = ur_internWord( (UCell*) &ur_thrGlobal, ur_intern( "none", 4 ) ); 
    225225    cell = vblk->ptr.cells + i; 
    226226    ur_initType( cell, UT_NONE ); 
     
    502502    //ur_makeBlock( 0 );        // 4 - BLK_DSTACK 
    503503 
    504     ur_pushContext( ut, (UCell*) &ur_global ); 
     504    ur_pushContext( ut, (UCell*) &ur_thrGlobal ); 
    505505 
    506506    { 
     
    530530    ur_evalCStr( _bootScript, sizeof(_bootScript) ); 
    531531#else 
    532     n = ur_tokenize( ut, _bootScript, 
    533                      _bootScript + sizeof(_bootScript), 0 ); 
     532    n = ur_tokenize( ut, _bootScript, _bootScript + sizeof(_bootScript) ); 
    534533    if( ! n ) 
    535534        return UR_EVAL_ERROR; 
    536     ur_bind( n, (UCell*) &ur_global ); 
     535    ur_bind( n, (UCell*) &ur_thrGlobal ); 
    537536    n = ur_eval( ut, n, 0 ); 
    538537    if( n != UR_EVAL_OK ) 
     
    674673    //ur_makeBlock( 1024 );     // 4 - BLK_DSTACK 
    675674 
    676     ur_pushContext( ut, (UCell*) &ur_global ); 
     675    ur_pushContext( ut, (UCell*) &ur_thrGlobal ); 
    677676 
    678677    ur_makeBinary( 0 );       // 0 - BIN_THREAD_TMP 
     
    855854    UCell* val; 
    856855 
    857     val = (UCell*) &ur_global; 
     856    val = (UCell*) &ur_thrGlobal; 
    858857    wrd = ur_lookup( val, firstAtom ); 
    859858    if( wrd < 0 )