blob: 6deebb53f663b032f9f7c39c064d9cd3908c7b1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/* $OpenBSD: thread_malloc_lock.c,v 1.6 2008/01/01 00:43:39 kurt Exp $ */
/* Public Domain <marc@snafu.org> */
#include <pthread.h>
#include "pthread_private.h"
static spinlock_t malloc_lock = _SPINLOCK_INITIALIZER;
static spinlock_t atexit_lock = _SPINLOCK_INITIALIZER;
static spinlock_t arc4_lock = _SPINLOCK_INITIALIZER;
void
_thread_malloc_lock()
{
_SPINLOCK(&malloc_lock);
}
void
_thread_malloc_unlock()
{
_SPINUNLOCK(&malloc_lock);
}
void
_thread_malloc_init()
{
}
void
_thread_atexit_lock()
{
_SPINLOCK(&atexit_lock);
}
void
_thread_atexit_unlock()
{
_SPINUNLOCK(&atexit_lock);
}
void
_thread_arc4_lock()
{
_SPINLOCK(&arc4_lock);
}
void
_thread_arc4_unlock()
{
_SPINUNLOCK(&arc4_lock);
}
|