1 /* Copyright (c) 2006-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "src/msg/msg_private.h"
9 #include "src/simix/smx_network_private.h"
11 #include "simgrid/s4u/mutex.hpp"
14 using namespace simgrid;
17 smx_mutex_t smx_mutex = simcall_mutex_init();
18 _mutex = std::shared_ptr<simgrid::simix::Mutex>(smx_mutex, SIMIX_mutex_destroy );
21 void s4u::Mutex::lock() {
22 simcall_mutex_lock(_mutex.get());
25 void s4u::Mutex::unlock() {
26 simcall_mutex_unlock(_mutex.get());
29 bool s4u::Mutex::try_lock() {
30 return simcall_mutex_trylock(_mutex.get());