From: Martin Quinson Date: Wed, 5 Jul 2017 14:37:53 +0000 (+0200) Subject: this header is C++ only X-Git-Tag: v3_17~466 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/aad6508d97c47103669dec38517d206ede703fc2 this header is C++ only --- diff --git a/src/kernel/activity/SynchroRaw.cpp b/src/kernel/activity/SynchroRaw.cpp index 509c41d5cd..0b11a05da3 100644 --- a/src/kernel/activity/SynchroRaw.cpp +++ b/src/kernel/activity/SynchroRaw.cpp @@ -1,11 +1,11 @@ -/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-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. */ #include "src/kernel/activity/SynchroRaw.hpp" +#include "src/simix/smx_synchro_private.hpp" #include "src/surf/surf_interface.hpp" -#include "src/simix/smx_synchro_private.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_synchro); diff --git a/src/kernel/context/Context.hpp b/src/kernel/context/Context.hpp index 8663333dd4..087b175ef1 100644 --- a/src/kernel/context/Context.hpp +++ b/src/kernel/context/Context.hpp @@ -13,22 +13,22 @@ #include -#include "src/internal_config.h" #include "simgrid/simix.h" +#include "src/instr/instr_private.h" +#include "src/internal_config.h" +#include "src/simix/popping_private.h" +#include "src/simix/smx_host_private.h" +#include "src/simix/smx_io_private.h" +#include "src/simix/smx_network_private.h" +#include "src/simix/smx_synchro_private.hpp" #include "surf/surf.h" #include "xbt/base.h" -#include "xbt/swag.h" +#include "xbt/config.h" #include "xbt/dict.h" +#include "xbt/function_types.h" #include "xbt/mallocator.h" -#include "xbt/config.h" +#include "xbt/swag.h" #include "xbt/xbt_os_time.h" -#include "xbt/function_types.h" -#include "src/instr/instr_private.h" -#include "src/simix/smx_host_private.h" -#include "src/simix/smx_io_private.h" -#include "src/simix/smx_network_private.h" -#include "src/simix/popping_private.h" -#include "src/simix/smx_synchro_private.h" #include #include "src/simix/ActorImpl.hpp" diff --git a/src/s4u/s4u_conditionVariable.cpp b/src/s4u/s4u_conditionVariable.cpp index 709276c58f..33e9df79fb 100644 --- a/src/s4u/s4u_conditionVariable.cpp +++ b/src/s4u/s4u_conditionVariable.cpp @@ -11,7 +11,7 @@ #include "simgrid/s4u/ConditionVariable.hpp" #include "simgrid/simix.h" -#include "src/simix/smx_synchro_private.h" +#include "src/simix/smx_synchro_private.hpp" namespace simgrid { namespace s4u { diff --git a/src/s4u/s4u_mutex.cpp b/src/s4u/s4u_mutex.cpp index 4f2cce6deb..5e63f24149 100644 --- a/src/s4u/s4u_mutex.cpp +++ b/src/s4u/s4u_mutex.cpp @@ -1,12 +1,11 @@ -/* Copyright (c) 2006-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-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. */ -#include "xbt/log.h" #include "src/msg/msg_private.h" -#include "src/simix/smx_synchro_private.h" +#include "src/simix/smx_synchro_private.hpp" +#include "xbt/log.h" #include "simgrid/s4u/Mutex.hpp" diff --git a/src/simix/smx_synchro_private.h b/src/simix/smx_synchro_private.hpp similarity index 84% rename from src/simix/smx_synchro_private.h rename to src/simix/smx_synchro_private.hpp index c263d25463..8eb66a5bcb 100644 --- a/src/simix/smx_synchro_private.h +++ b/src/simix/smx_synchro_private.hpp @@ -23,7 +23,7 @@ public: bool try_lock(smx_actor_t issuer); void unlock(smx_actor_t issuer); - bool locked = false; + bool locked = false; smx_actor_t owner = nullptr; // List of sleeping processes: xbt_swag_t sleeping = nullptr; @@ -46,25 +46,24 @@ public: simgrid::s4u::Mutex& mutex() { return mutex_; } private: - std::atomic_int_fast32_t refcount_ { 1 }; + std::atomic_int_fast32_t refcount_{1}; simgrid::s4u::Mutex mutex_; }; - } } typedef struct s_smx_cond { s_smx_cond() : cond_(this) {} - std::atomic_int_fast32_t refcount_ { 1 }; - smx_mutex_t mutex = nullptr; - xbt_swag_t sleeping = nullptr; /* list of sleeping process */ + std::atomic_int_fast32_t refcount_{1}; + smx_mutex_t mutex = nullptr; + xbt_swag_t sleeping = nullptr; /* list of sleeping process */ simgrid::s4u::ConditionVariable cond_; } s_smx_cond_t; typedef struct s_smx_sem { unsigned int value; - xbt_swag_t sleeping; /* list of sleeping process */ + xbt_swag_t sleeping; /* list of sleeping process */ } s_smx_sem_t; XBT_PRIVATE void SIMIX_post_synchro(smx_activity_t synchro); @@ -75,8 +74,8 @@ XBT_PRIVATE void SIMIX_synchro_finish(smx_activity_t synchro); XBT_PRIVATE smx_cond_t SIMIX_cond_init(); XBT_PRIVATE void SIMIX_cond_broadcast(smx_cond_t cond); XBT_PRIVATE void SIMIX_cond_signal(smx_cond_t cond); -XBT_PRIVATE void intrusive_ptr_add_ref(s_smx_cond_t *cond); -XBT_PRIVATE void intrusive_ptr_release(s_smx_cond_t *cond); +XBT_PRIVATE void intrusive_ptr_add_ref(s_smx_cond_t* cond); +XBT_PRIVATE void intrusive_ptr_release(s_smx_cond_t* cond); XBT_PRIVATE XBT_PRIVATE smx_sem_t SIMIX_sem_init(unsigned int value); XBT_PRIVATE void SIMIX_sem_release(smx_sem_t sem); diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index dd2b085502..6415bbbe5b 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -29,7 +29,7 @@ set(EXTRA_DIST src/simix/smx_io_private.h src/simix/smx_network_private.h src/simix/smx_private.h - src/simix/smx_synchro_private.h + src/simix/smx_synchro_private.hpp src/smpi/colls/coll_tuned_topo.h src/smpi/colls/colls_private.h src/smpi/colls/smpi_mvapich2_selector_stampede.h