diff options
-rw-r--r-- | libblake_init.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libblake_init.c b/libblake_init.c index 84dd87e..0276cd2 100644 --- a/libblake_init.c +++ b/libblake_init.c @@ -15,6 +15,9 @@ libblake_init(void) static volatile int initialised = 0; static volatile atomic_flag spinlock = ATOMIC_FLAG_INIT; + if (initialised) + return; + while (atomic_flag_test_and_set(&spinlock)); if (!initialised) { |