Statistics
| Branch: | Revision:

root / src / sim / cbarriermessage.cc @ 94cf1056

History | View | Annotate | Download (1.21 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"), valid(true)
27
{
28
    sem_init(&sem, 0, 0);
29
}
30

    
31

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

    
38

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

    
44

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