Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
stick to our coding standards: fields must have a trailing _
[simgrid.git] / src / kernel / activity / ConditionVariableImpl.cpp
index 5efb83c..1ec77be 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,7 +8,7 @@
 #include "src/kernel/activity/MutexImpl.hpp"
 #include "src/kernel/activity/SynchroRaw.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ConditionVariable, simix_synchro, "Condition variables");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_condition, simix_synchro, "Condition variables");
 
 /********************************* Condition **********************************/
 
@@ -28,9 +28,6 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-ConditionVariableImpl::ConditionVariableImpl() : cond_(this) {}
-ConditionVariableImpl::~ConditionVariableImpl() = default;
-
 /**
  * @brief Signalizes a condition.
  *
@@ -48,10 +45,10 @@ void ConditionVariableImpl::signal()
     sleeping_.pop_front();
 
     /* Destroy waiter's synchronization */
-    proc.waiting_synchro = nullptr;
+    proc.waiting_synchro_ = nullptr;
 
     /* Now transform the cond wait simcall into a mutex lock one */
-    smx_simcall_t simcall = &proc.simcall;
+    smx_simcall_t simcall = &proc.simcall_;
     MutexImpl* simcall_mutex;
     if (simcall->call_ == SIMCALL_COND_WAIT)
       simcall_mutex = simcall_cond_wait__get__mutex(simcall);
@@ -85,7 +82,7 @@ void ConditionVariableImpl::wait(smx_mutex_t mutex, double timeout, actor::Actor
 
   /* If there is a mutex unlock it */
   if (mutex != nullptr) {
-    xbt_assert(mutex->owner_ == issuer,
+    xbt_assert(mutex->get_owner() == issuer,
                "Actor %s cannot wait on ConditionVariable %p since it does not own the provided mutex %p",
                issuer->get_cname(), this, mutex);
     mutex_ = mutex;
@@ -94,7 +91,7 @@ void ConditionVariableImpl::wait(smx_mutex_t mutex, double timeout, actor::Actor
 
   RawImplPtr synchro(new RawImpl());
   synchro->set_host(issuer->get_host()).set_timeout(timeout).start();
-  synchro->register_simcall(&issuer->simcall);
+  synchro->register_simcall(&issuer->simcall_);
   sleeping_.push_back(*issuer);
 }