Show
Ignore:
Timestamp:
05/17/07 16:25:27 (18 months ago)
Author:
krobillard
Message:

Thread safe Thune -

The only globals are now the static ur_global & ur_envGlobal.
Each thread has own data store.
Series data now accessed through functions which take thread pointer.
Word names now part of UrlanEnv? - no longer a binary!
Hold/release now implemented with a block.

Files:
1 modified

Legend:

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

    r369 r387  
    2121#include <assert.h> 
    2222#include <stdio.h> 
    23 #include "urlan.h" 
     23#include "env.h" 
    2424 
    2525 
     
    4040#else 
    4141 
    42 #define APPNAME     "Thune" 
     42#define APPNAME     "Bloc3" 
    4343#define CUSTOM_DT           0 
    4444#define CUSTOM_DT_COUNT     0 
     
    7777 
    7878 
    79 static void reportError( UThread* th ) 
     79static void reportError( UThread* ut ) 
    8080{ 
    8181    UString* str; 
    8282#if 0 
    8383    UCell* val; 
    84     val = ur_result( th, 0 ); 
     84    val = ur_result( ut, 0 ); 
    8585    str = ur_binPtr( val->err.strN ); 
    8686 
     
    8989            str->ptr.c ); 
    9090#else 
    91     str = ur_binPtr( th->callTempBinN ); 
     91    str = ur_threadTmp( ut ); 
    9292    str->used = 0; 
    93     ur_toStr( ur_result(th, 0), str, 0 ); 
     93    ur_toStr( ur_result(ut, 0), str, 0 ); 
    9494    ur_termCStr( str ); 
    9595    printf( str->ptr.c ); 
    9696#endif 
    9797 
    98     //ur_threadReset( th ); 
     98    //ur_threadReset( ut ); 
    9999} 
    100100 
     
    132132    } 
    133133#endif 
     134 
     135    ur_freezeEnv( env.threads, 128, 256 ); 
    134136 
    135137    if( argc > 1 ) 
     
    255257 
    256258                        ur_arrayInit( &str, 1, 0 ); 
    257                         ur_toStr( val, &str, 0 ); 
     259                        ur_toStrT( env.threads, val, &str, 0 ); 
    258260                        if( str.ptr.c ) 
    259261                        {