From: Arnaud Giersch Date: Thu, 14 Feb 2013 16:28:13 +0000 (+0100) Subject: Remove remaining traces from synchronized dynars. X-Git-Tag: v3_9_90~491^2~16 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/57025160719eaf8b0c9912dbd0605d05f8b4f369 Remove remaining traces from synchronized dynars. Had to add some #include "xbt/synchro_core.h". --- diff --git a/examples/msg/migration/migration.c b/examples/msg/migration/migration.c index 87df4982dc..95bd58c4ef 100644 --- a/examples/msg/migration/migration.c +++ b/examples/msg/migration/migration.c @@ -6,6 +6,7 @@ #include "msg/msg.h" /* core library */ #include "xbt/sysdep.h" /* calloc */ +#include "xbt/synchro_core.h" /* Create a log channel to have nice outputs. */ #include "xbt/log.h" diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index 5f0a61517a..7c3c44b734 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -206,19 +206,14 @@ XBT_PUBLIC(void *) xbt_dynar_pop_ptr(xbt_dynar_t const dynar); * DynArr during the traversal. To remove elements, use the * xbt_dynar_cursor_rm() function. * - * Do not call these functions directly, but only the xbt_dynar_foreach macro. - * - * For synchronized dynars, the dynar will be locked during the whole - * loop and it will get unlocked automatically if you traverse all - * elements. If you want to break the loop before the end, make sure - * to call xbt_dynar_cursor_unlock() before the break; + * Do not call these function directly, but only within the xbt_dynar_foreach + * macro. * * @{ */ XBT_PUBLIC(void) xbt_dynar_cursor_rm(xbt_dynar_t dynar, unsigned int *const cursor); -XBT_PUBLIC(void) xbt_dynar_cursor_unlock(xbt_dynar_t dynar); /* do not use this structure internals directly, but use the public interface * This was made public to allow: @@ -226,7 +221,6 @@ XBT_PUBLIC(void) xbt_dynar_cursor_unlock(xbt_dynar_t dynar); * - sending such beasts over the network */ -#include "xbt/synchro_core.h" typedef struct xbt_dynar_s { unsigned long size; unsigned long used; diff --git a/src/bindings/java/jmsg_synchro.c b/src/bindings/java/jmsg_synchro.c index 35acc6f40c..cbccf4cd26 100644 --- a/src/bindings/java/jmsg_synchro.c +++ b/src/bindings/java/jmsg_synchro.c @@ -5,6 +5,7 @@ /* 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/synchro_core.h" #include "jmsg_synchro.h" #include "jxbt_utilities.h" diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 8c7cd9f162..6924f0bd89 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -548,9 +548,6 @@ int xbt_dynar_member(xbt_dynar_t const dynar, void *const elem) */ XBT_INLINE void *xbt_dynar_push_ptr(xbt_dynar_t const dynar) { - /* we have to inline xbt_dynar_insert_at_ptr here to make sure that - dynar->used don't change between reading it and getting the lock - within xbt_dynar_insert_at_ptr */ return xbt_dynar_insert_at_ptr(dynar, dynar->used); } @@ -559,8 +556,7 @@ XBT_INLINE void xbt_dynar_push(xbt_dynar_t const dynar, const void *const src) { /* checks done in xbt_dynar_insert_at_ptr */ - memcpy(xbt_dynar_insert_at_ptr(dynar, dynar->used), src, - dynar->elmsize); + memcpy(xbt_dynar_insert_at_ptr(dynar, dynar->used), src, dynar->elmsize); } /** @brief Mark the last dynar's element as unused and return a pointer to it. diff --git a/src/xbt/ex.c b/src/xbt/ex.c index ac2fa9b01b..f383208ff0 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -46,6 +46,7 @@ #include "portable.h" /* execinfo when available */ #include "xbt/ex.h" #include "xbt/str.h" +#include "xbt/synchro_core.h" #include "xbt_modinter.h" /* backtrace initialization headers */ #include "xbt/ex_interface.h" diff --git a/src/xbt/xbt_log_layout_format.c b/src/xbt/xbt_log_layout_format.c index 9801a74479..bbe1cb109b 100644 --- a/src/xbt/xbt_log_layout_format.c +++ b/src/xbt/xbt_log_layout_format.c @@ -7,6 +7,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "portable.h" /* execinfo when available */ +#include "xbt/synchro_core.h" /* xbt_thread_self_name */ #include "xbt/ex_interface.h" #include "xbt/sysdep.h" #include "xbt/strbuff.h" diff --git a/src/xbt/xbt_queue.c b/src/xbt/xbt_queue.c index 6dc3c95f80..78e578ca92 100644 --- a/src/xbt/xbt_queue.c +++ b/src/xbt/xbt_queue.c @@ -11,6 +11,7 @@ #include "xbt/sysdep.h" #include "xbt/log.h" #include "xbt/dynar.h" +#include "xbt/synchro_core.h" #include "xbt/queue.h" /* this module */ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_queue, xbt, diff --git a/src/xbt/xbt_sg_synchro.c b/src/xbt/xbt_sg_synchro.c index f0f87efa7e..ae49355926 100644 --- a/src/xbt/xbt_sg_synchro.c +++ b/src/xbt/xbt_sg_synchro.c @@ -10,6 +10,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/ex.h" +#include "xbt/synchro_core.h" #include "simgrid/simix.h" /* used implementation */ #include "../simix/smx_private.h" /* FIXME */ diff --git a/tools/tesh/run_context.h b/tools/tesh/run_context.h index d888d84741..0d20b02c1f 100644 --- a/tools/tesh/run_context.h +++ b/tools/tesh/run_context.h @@ -10,6 +10,7 @@ #define TESH_RUN_CONTEXT_H #include "tesh.h" +#include "xbt/synchro_core.h" typedef enum { e_output_check, e_output_display, e_output_ignore