Statistics
| Branch: | Revision:

root / include / cttaslock.h @ 47c4b975

History | View | Annotate | Download (1.13 KB)

1 93d0d4d3 Simon Tenbusch
//==========================================================================
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 e118c57b Simon Tenbusch
 Copyright (C) 2011 Simon Tenbusch
15 93d0d4d3 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 93d0d4d3 Simon Tenbusch
 *--------------------------------------------------------------*/
19
20
#ifndef CTTASLOCK_H_
21
#define CTTASLOCK_H_
22
23
#include "clock.h"
24
25
#ifdef ATOMIC_OPS_DEBUG
26 e118c57b Simon Tenbusch
#include "catomicopsdebug.h"
27 93d0d4d3 Simon Tenbusch
#else
28 e118c57b Simon Tenbusch
#include <atomic_ops.h>
29 93d0d4d3 Simon Tenbusch
#endif
30
31 e118c57b Simon Tenbusch
class cTTASLock: public cLock
32
{
33 93d0d4d3 Simon Tenbusch
private:
34 e118c57b Simon Tenbusch
    AO_t lck;
35 93d0d4d3 Simon Tenbusch
36
public:
37 e118c57b Simon Tenbusch
    /**
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 93d0d4d3 Simon Tenbusch
57
};
58
59
#endif /* CTTASLOCK_H_ */