Statistics
| Branch: | Revision:

root / include / cpthreadlock.h @ 47c4b975

History | View | Annotate | Download (1.09 KB)

1 2c43d39b Simon Tenbusch
//==========================================================================
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 e118c57b Simon Tenbusch
 Copyright (C) 2011 Simon Tenbusch
15 2c43d39b Simon Tenbusch

16 e118c57b Simon Tenbusch
 This file is distributed WITHOUT ANY WARRANTY. See the file
17
 `license' for details on this and other legal matters.
18 2c43d39b Simon Tenbusch
 *--------------------------------------------------------------*/
19
20
#ifndef CPTHREADLOCK_H_
21
#define CPTHREADLOCK_H_
22
23
#include "clock.h"
24
25
#include <pthread.h>
26
27 e118c57b Simon Tenbusch
class cPThreadLock: public cLock
28
{
29 2c43d39b Simon Tenbusch
private:
30 93d0d4d3 Simon Tenbusch
    pthread_mutex_t mutex;
31 2c43d39b Simon Tenbusch
public:
32 e118c57b Simon Tenbusch
    /**
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 2c43d39b Simon Tenbusch
52
};
53
54
#endif /* CPHTREADLOCK_H_ */