X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fprng%2Frandom.c;h=633a17f6902fcf9e287c0ecbc921304513bf23a9;hb=6aeb9c6703670649ee09b3c8575fb428168bb75c;hp=e250e28e98919eca4f3c9e880b9de54ba23d2fd5;hpb=1569f396bb76e9d54f6c4492ed6778e37b87bc70;p=musl diff --git a/src/prng/random.c b/src/prng/random.c index e250e28e..633a17f6 100644 --- a/src/prng/random.c +++ b/src/prng/random.c @@ -1,6 +1,6 @@ #include #include -#include "libc.h" +#include "lock.h" /* this code uses the same lagged fibonacci generator as the @@ -22,7 +22,7 @@ static int n = 31; static int i = 3; static int j = 0; static uint32_t *x = init+1; -static int lock[2]; +static volatile int lock[1]; static uint32_t lcg31(uint32_t x) { return (1103515245*x + 12345) & 0x7fffffff;