Statistics
| Branch: | Revision:

root / include / cttaslock.h @ 47c4b975

History | View | Annotate | Download (1.13 KB)

1
//==========================================================================
2
//  CTTASLOCK.H - part of
3
//
4
//                     Horizon/OMNeT++/OMNEST
5
//            Discrete System Simulation in C++
6
//
7
//
8
//  Declaration of the following classes:
9
//    cTTASLock: Encapsulating Test and Test and Set 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 CTTASLOCK_H_
21
#define CTTASLOCK_H_
22

    
23
#include "clock.h"
24

    
25
#ifdef ATOMIC_OPS_DEBUG
26
#include "catomicopsdebug.h"
27
#else
28
#include <atomic_ops.h>
29
#endif
30

    
31
class cTTASLock: public cLock
32
{
33
private:
34
    AO_t lck;
35

    
36
public:
37
    /**
38
     * Constructor.
39
     */
40
    cTTASLock();
41

    
42
    /**
43
     * Destructor.
44
     */
45
    virtual ~cTTASLock();
46

    
47
    /*
48
     * Locks the lock
49
     */
50
    void lock();
51

    
52
    /*
53
     * Unlocks the lock
54
     */
55
    void unlock();
56

    
57
};
58

    
59
#endif /* CTTASLOCK_H_ */