1 /* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
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. */
6 #include "src/kernel/activity/ActivityImpl.hpp"
8 XBT_LOG_EXTERNAL_CATEGORY(simix_process);
14 ActivityImpl::ActivityImpl() = default;
15 ActivityImpl::~ActivityImpl() = default;
17 // boost::intrusive_ptr<Activity> support:
18 void intrusive_ptr_add_ref(simgrid::kernel::activity::ActivityImpl* activity)
20 xbt_assert(activity->refcount_ >= 0);
21 activity->refcount_++;
22 XBT_CDEBUG(simix_process, "%p->refcount++ ~> %d", activity, (int)activity->refcount_);
23 if (XBT_LOG_ISENABLED(simix_process, xbt_log_priority_trace))
24 xbt_backtrace_display_current();
27 void intrusive_ptr_release(simgrid::kernel::activity::ActivityImpl* activity)
29 XBT_CDEBUG(simix_process, "%p->refcount-- ~> %d", activity, ((int)activity->refcount_) - 1);
30 xbt_assert(activity->refcount_ >= 0);
31 activity->refcount_--;
32 if (XBT_LOG_ISENABLED(simix_process, xbt_log_priority_trace))
33 xbt_backtrace_display_current();
34 if (activity->refcount_ <= 0)
39 } // namespace simgrid::kernel::activity::