Statistics
| Branch: | Revision:

root / src / sim / cbarriermessage.cc @ 463434d4

History | View | Annotate | Download (1.22 KB)

1
//=========================================================================
2
//  CBARRIERMESSGE.CC - part of
3
//
4
//                  Horizon/OMNeT++/OMNEST
5
//           Discrete System Simulation in C++
6
//
7
//
8
//   Member functions of
9
//    cBarrierMessage  : special purpose message for coordinating parallel
10
//                       event execution
11
//
12
//  Author: Georg Kunz
13
//
14
//=========================================================================
15

    
16
/*--------------------------------------------------------------*
17
  Copyright (C) 2009 Georg Kunz
18

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

    
23
#include "cbarriermessage.h"
24

    
25
cBarrierMessage::cBarrierMessage() :
26
    cMessage("BarrierMessage")
27
{
28
    sem_init(&sem, 0, 0);
29
    AO_store(&valid, 1);
30
}
31

    
32

    
33
cBarrierMessage::cBarrierMessage(const cBarrierMessage& msg) : cMessage(msg)
34
{
35
    operator=(msg);
36
    sem_init(&sem, 0, 0);
37
}
38

    
39

    
40
cBarrierMessage::~cBarrierMessage()
41
{
42
    sem_destroy(&sem);
43
}
44

    
45

    
46
cBarrierMessage& cBarrierMessage::operator=(const cBarrierMessage& msg)
47
{
48
    if (this==&msg) return *this;
49
    cMessage::operator=(msg);
50
    return *this;
51
}