X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1ce1dfaf3f356d7f194feca63a63c82d9c5cca4b..2ca35a707044d033c33cb4f016e6ffddfded0d05:/include/simgrid/s4u/mutex.hpp diff --git a/include/simgrid/s4u/mutex.hpp b/include/simgrid/s4u/mutex.hpp deleted file mode 100644 index a863b7dd0a..0000000000 --- a/include/simgrid/s4u/mutex.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2006-2015. 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 SIMGRID_S4U_MUTEX_HPP -#define SIMGRID_S4U_MUTEX_HPP - -#include -#include - -#include - -#include -#include "simgrid/simix.h" - -namespace simgrid { -namespace s4u { - -class ConditionVariable; - -XBT_PUBLIC_CLASS Mutex { -friend ConditionVariable; -private: - friend simgrid::simix::Mutex; - simgrid::simix::Mutex* mutex_; - Mutex(simgrid::simix::Mutex* mutex) : mutex_(mutex) {} -public: - - friend void intrusive_ptr_add_ref(Mutex* mutex) - { - xbt_assert(mutex); - SIMIX_mutex_ref(mutex->mutex_); - } - friend void intrusive_ptr_release(Mutex* mutex) - { - xbt_assert(mutex); - SIMIX_mutex_unref(mutex->mutex_); - } - using Ptr = boost::intrusive_ptr; - - // No copy: - Mutex(Mutex const&) = delete; - Mutex& operator(Mutex const&) = delete; - - static Ptr createMutex(); - -public: - void lock(); - void unlock(); - bool try_lock(); -}; - -using MutexPtr = Mutex::Ptr; - -}} // namespace simgrid::s4u - -#endif /* SIMGRID_S4U_MUTEX_HPP */