Ignore:
Timestamp:
Jan 12, 2022, 9:30:48 PM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
42daeb4
Parents:
1959528 (diff), 07a1e7a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Peter A. Buhr <pabuhr@…> (01/12/22 18:35:04)
git-committer:
Peter A. Buhr <pabuhr@…> (01/12/22 21:30:48)
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/stdlib.cfa

    r1959528 r00f5fde  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 12 16:25:36 2022
    13 // Update Count     : 578
     12// Last Modified On : Wed Jan 12 18:52:41 2022
     13// Update Count     : 582
    1414//
    1515
     
    242242} // LCG
    243243
    244 uint32_t __global_random_seed;
     244uint32_t __global_random_seed;                                                  // sequential/concurrent
     245uint32_t __global_random_state;                                                 // sequential only
    245246
    246247void set_seed( PRNG & prng, uint32_t seed_ ) with( prng ) { state = seed = seed_; GENERATOR( state ); } // set seed
    247248uint32_t prng( PRNG & prng ) with( prng ) { callcnt += 1; return GENERATOR( state ); }
    248249
    249 void set_seed( uint32_t seed ) {
    250         active_thread()->random_state = __global_random_seed = seed;
    251         GENERATOR( active_thread()->random_state );
    252 } // set_seed
     250void set_seed( uint32_t seed ) { __global_random_seed = seed; GENERATOR( __global_random_state ); }
    253251uint32_t get_seed() { return __global_random_seed; }
    254 uint32_t prng( void ) { return GENERATOR( active_thread()->random_state ); } // [0,UINT_MAX]
     252uint32_t prng( void ) { return GENERATOR( __global_random_state ); } // [0,UINT_MAX]
    255253
    256254//---------------------------------------
Note: See TracChangeset for help on using the changeset viewer.