-/* 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 <atomic>
-
-#include <simgrid/s4u/Mutex.hpp>
-#include <simgrid/s4u/conditionVariable.hpp>
-
-#include "xbt/base.h"
+#include "simgrid/s4u/ConditionVariable.hpp"
#include "xbt/swag.h"
-#include "xbt/xbt_os_thread.h"
-#include "src/simix/popping_private.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);
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_);
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