Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / simix / Synchro.cpp
1 /* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "src/simix/Synchro.h"
7
8 simgrid::simix::Synchro::Synchro()
9 {
10 }
11
12 simgrid::simix::Synchro::~Synchro()
13 {
14 }
15
16 void simgrid::simix::Synchro::ref()
17 {
18   refcount++;
19 }
20
21 void simgrid::simix::Synchro::unref()
22 {
23   xbt_assert(refcount > 0,
24       "This synchro has a negative refcount! You can only call test() or wait() once per synchronization.");
25
26   refcount--;
27   if (refcount>0)
28     return;
29   delete this;
30 }