arc4_lock.c (276541) | arc4_lock.c (276605) |
---|---|
1/* arc4_lock.c - global lock for arc4random 2* 3 * Copyright (c) 2014, NLnet Labs. All rights reserved. 4 * 5 * This software is open source. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 39 unchanged lines hidden (view full) --- 48} 49#else /* !THREADS_DISABLED */ 50 51static lock_quick_t arc4lock; 52static int arc4lockinit = 0; 53 54void _ARC4_LOCK(void) 55{ | 1/* arc4_lock.c - global lock for arc4random 2* 3 * Copyright (c) 2014, NLnet Labs. All rights reserved. 4 * 5 * This software is open source. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 39 unchanged lines hidden (view full) --- 48} 49#else /* !THREADS_DISABLED */ 50 51static lock_quick_t arc4lock; 52static int arc4lockinit = 0; 53 54void _ARC4_LOCK(void) 55{ |
56 if(!arc4lockinit) | 56 if(!arc4lockinit) { 57 arc4lockinit = 1; |
57 lock_quick_init(&arc4lock); | 58 lock_quick_init(&arc4lock); |
59 } |
|
58 lock_quick_lock(&arc4lock); 59} 60 61void _ARC4_UNLOCK(void) 62{ 63 lock_quick_unlock(&arc4lock); 64} 65#endif /* THREADS_DISABLED */ | 60 lock_quick_lock(&arc4lock); 61} 62 63void _ARC4_UNLOCK(void) 64{ 65 lock_quick_unlock(&arc4lock); 66} 67#endif /* THREADS_DISABLED */ |