Revision e118c57b src/sim/cpthreadlock.cc

View differences:

src/sim/cpthreadlock.cc
7 7
//==========================================================================
8 8

  
9 9
/*--------------------------------------------------------------*
10
  Copyright (C) 2011 Simon Tenbusch
10
 Copyright (C) 2011 Simon Tenbusch
11 11

  
12
  This file is distributed WITHOUT ANY WARRANTY. See the file
13
  `license' for details on this and other legal matters.
12
 This file is distributed WITHOUT ANY WARRANTY. See the file
13
 `license' for details on this and other legal matters.
14 14
 *--------------------------------------------------------------*/
15 15

  
16 16
#include "simkerneldefs.h"
17 17
#include "cpthreadlock.h"
18 18

  
19

  
20
	cPThreadLock::cPThreadLock() {
21
		pthread_mutex_init(&mutex, NULL);
22
	}
23

  
24
	cPThreadLock::~cPThreadLock()
25
	{
26
	    pthread_mutex_destroy(&mutex);
27
	}
28

  
29
	void cPThreadLock::lock() {
30
	    pthread_mutex_lock(&mutex);
31
	}
32

  
33
	void cPThreadLock::unlock() {
34
	    pthread_mutex_unlock(&mutex);
35
	}
19
cPThreadLock::cPThreadLock()
20
{
21
    pthread_mutex_init(&mutex, NULL);
22
}
23

  
24
cPThreadLock::~cPThreadLock()
25
{
26
    pthread_mutex_destroy(&mutex);
27
}
28

  
29
void cPThreadLock::lock()
30
{
31
    pthread_mutex_lock(&mutex);
32
}
33

  
34
void cPThreadLock::unlock()
35
{
36
    pthread_mutex_unlock(&mutex);
37
}
36 38

  

Also available in: Unified diff