[go: up one dir, main page]

Menu

[8bf46b]: / common / rwlock.h  Maximize  Restore  History

Download this file

55 lines (42 with data), 875 Bytes

 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
51
52
53
54
#ifndef RWLOCK_HEADER
#define RWLOCK_HEADER
/***************************************************************************
* rwlock.h
*
* Sat Aug 24 23:53:44 2002
* Copyright 2002 Roman Dementiev
* dementiev@mpi-sb.mpg.de
****************************************************************************/
#include "utils.h"
#if 0 // not used
#include <pthread.h>
namespace stxxl
{
class RWLock
{
pthread_rwlock_t rwlock;
public:
RWLock ()
{
stxxl_nassert (pthread_rwlock_init (&rwlock, NULL));
};
~RWLock ()
{
stxxl_nassert (pthread_rwlock_destroy (&rwlock));
};
void rdlock ()
{
stxxl_nassert (pthread_rwlock_rdlock (&rwlock));
};
void wrlock ()
{
stxxl_nassert (pthread_rwlock_rdlock (&wrlock));
};
void unlock ()
{
stxxl_nassert (pthread_rwlock_unlock (&mutex));
};
};
}
#endif
#endif