Browse Source

Prefer _MUTEX_*LOCK over _THREAD_PRIVATE_MUTEX_*LOCK() when thread-specific

data isn't necessary.
ok mpi@, ok&tweak natano@
OPENBSD_6_0
guenther 8 years ago
parent
commit
f99de10a1e
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/lib/libc/stdlib/random.c

+ 4
- 4
src/lib/libc/stdlib/random.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: random.c,v 1.29 2015/01/16 16:48:51 deraadt Exp $ */
/* $OpenBSD: random.c,v 1.30 2016/04/05 04:29:21 guenther Exp $ */
/* /*
* Copyright (c) 1983 Regents of the University of California. * Copyright (c) 1983 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -175,11 +175,11 @@ static int rand_sep = SEP_3;
static int random_deterministic; static int random_deterministic;
_THREAD_PRIVATE_MUTEX(random);
static void *random_mutex;
static long random_l(void); static long random_l(void);
#define LOCK() _THREAD_PRIVATE_MUTEX_LOCK(random)
#define UNLOCK() _THREAD_PRIVATE_MUTEX_UNLOCK(random)
#define LOCK() _MUTEX_LOCK(&random_mutex)
#define UNLOCK() _MUTEX_UNLOCK(&random_mutex)
/* /*
* srandom: * srandom:


Loading…
Cancel
Save