Ignore:
Timestamp:
Nov 22, 2022, 10:18:04 AM (19 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
20cf96d
Parents:
1553a55 (diff), d41735a (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.
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/thread.cfa

    r1553a55 r29702ad  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 12 15:24:18 2022
    13 // Update Count     : 66
     12// Last Modified On : Sun Nov 20 17:17:50 2022
     13// Update Count     : 80
    1414//
    1515
     
    2626#include "invoke.h"
    2727
    28 extern uint32_t __global_random_seed, __global_random_prime, __global_random_mask;
     28extern PRNG_ARG_T __global_random_seed, __global_random_prime;
     29extern bool __global_random_mask;
    2930
    3031#pragma GCC visibility push(default)
     
    225226
    226227//-----------------------------------------------------------------------------
    227 #define GENERATOR LCG
    228 
    229 void set_seed( uint32_t seed ) {
    230         uint32_t & state = active_thread()->random_state;
     228
     229void set_seed( uint64_t seed ) {
     230        PRNG_ARG_T & state = active_thread()->random_state;
    231231        state = __global_random_seed = seed;
    232         GENERATOR( state );
     232        (void)PRNG_NAME( state );                                                       // prime PRNG
    233233        __global_random_prime = state;
    234234        __global_random_mask = true;
    235235} // set_seed
    236236
    237 uint32_t prng( void ) {                                                                 // [0,UINT_MAX]
    238         uint32_t & state = active_thread()->random_state;
    239         return GENERATOR( state );
     237uint64_t prng( void ) {                                                                 // [0,UINT_MAX]
     238        PRNG_ARG_T & state = active_thread()->random_state;
     239        return PRNG_NAME( state );
    240240} // prng
    241241
Note: See TracChangeset for help on using the changeset viewer.