Statistics
| Branch: | Revision:

root / include / cpthreadlock.h @ 47c4b975

History | View | Annotate | Download (1.09 KB)

1
//==========================================================================
2
//  CPTHREADLOCK.H - part of
3
//
4
//                     Horizon/OMNeT++/OMNEST
5
//            Discrete System Simulation in C++
6
//
7
//
8
//  Declaration of the following classes:
9
//    cPThreadLock: Encapsulating pThread lock
10
//
11
//==========================================================================
12

    
13
/*--------------------------------------------------------------*
14
 Copyright (C) 2011 Simon Tenbusch
15

16
 This file is distributed WITHOUT ANY WARRANTY. See the file
17
 `license' for details on this and other legal matters.
18
 *--------------------------------------------------------------*/
19

    
20
#ifndef CPTHREADLOCK_H_
21
#define CPTHREADLOCK_H_
22

    
23
#include "clock.h"
24

    
25
#include <pthread.h>
26

    
27
class cPThreadLock: public cLock
28
{
29
private:
30
    pthread_mutex_t mutex;
31
public:
32
    /**
33
     * Constructor.
34
     */
35
    cPThreadLock();
36

    
37
    /**
38
     * Destructor.
39
     */
40
    virtual ~cPThreadLock();
41

    
42
    /*
43
     * Locks the lock
44
     */
45
    virtual void lock();
46

    
47
    /*
48
     * Unlocks the lock
49
     */
50
    virtual void unlock();
51

    
52
};
53

    
54
#endif /* CPHTREADLOCK_H_ */