Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
acknowledge that #120 can be seen here
[simgrid.git] / src / simix / smx_synchro_private.h
index a8c4dad..c263d25 100644 (file)
@@ -1,23 +1,23 @@
-/* Copyright (c) 2012-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2017. 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. */
 
-#ifndef _SIMIX_SYNCHRO_PRIVATE_H
-#define _SIMIX_SYNCHRO_PRIVATE_H
+#ifndef SIMIX_SYNCHRO_PRIVATE_H
+#define SIMIX_SYNCHRO_PRIVATE_H
 
-#include "simgrid/s4u/conditionVariable.hpp"
+#include "simgrid/s4u/ConditionVariable.hpp"
 #include "xbt/swag.h"
 
 namespace simgrid {
 namespace simix {
 
-class XBT_PUBLIC() Mutex {
+class XBT_PUBLIC() MutexImpl {
 public:
-  Mutex();
-  ~Mutex();
-  Mutex(Mutex const&) = delete;
-  Mutex& operator=(Mutex const&) = delete;
+  MutexImpl();
+  ~MutexImpl();
+  MutexImpl(MutexImpl const&) = delete;
+  MutexImpl& operator=(MutexImpl const&) = delete;
 
   void lock(smx_actor_t issuer);
   bool try_lock(smx_actor_t issuer);
@@ -29,14 +29,13 @@ public:
   xbt_swag_t sleeping = nullptr;
 
   // boost::intrusive_ptr<Mutex> support:
-  friend void intrusive_ptr_add_ref(Mutex* mutex)
+  friend void intrusive_ptr_add_ref(MutexImpl* mutex)
   {
     // Atomic operation! Do not split in two instructions!
-    auto previous = (mutex->refcount_)++;
+    XBT_ATTRIB_UNUSED auto previous = (mutex->refcount_)++;
     xbt_assert(previous != 0);
-    (void) previous;
   }
-  friend void intrusive_ptr_release(Mutex* mutex)
+  friend void intrusive_ptr_release(MutexImpl* mutex)
   {
     // Atomic operation! Do not split in two instructions!
     auto count = --(mutex->refcount_);
@@ -83,4 +82,5 @@ XBT_PRIVATE XBT_PRIVATE smx_sem_t SIMIX_sem_init(unsigned int value);
 XBT_PRIVATE void SIMIX_sem_release(smx_sem_t sem);
 XBT_PRIVATE int SIMIX_sem_would_block(smx_sem_t sem);
 XBT_PRIVATE int SIMIX_sem_get_capacity(smx_sem_t sem);
+
 #endif