Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
typo
[simgrid.git] / src / kernel / activity / ActivityImpl.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/kernel/activity/ActivityImpl.hpp"
7
8 simgrid::kernel::activity::ActivityImpl::ActivityImpl() = default;
9 simgrid::kernel::activity::ActivityImpl::~ActivityImpl() = default;
10
11 void simgrid::kernel::activity::ActivityImpl::ref()
12 {
13   refcount++;
14 }
15
16 void simgrid::kernel::activity::ActivityImpl::unref()
17 {
18   xbt_assert(refcount > 0,
19       "This activity has a negative refcount! You can only call test() or wait() once per activity.");
20
21   refcount--;
22   if (refcount>0)
23     return;
24   delete this;
25 }