Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove remaining traces from synchronized dynars.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 14 Feb 2013 16:28:13 +0000 (17:28 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 14 Feb 2013 16:35:13 +0000 (17:35 +0100)
Had to add some #include "xbt/synchro_core.h".

examples/msg/migration/migration.c
include/xbt/dynar.h
src/bindings/java/jmsg_synchro.c
src/xbt/dynar.c
src/xbt/ex.c
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_queue.c
src/xbt/xbt_sg_synchro.c
tools/tesh/run_context.h

index 87df498..95bd58c 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "msg/msg.h"            /* core library */
 #include "xbt/sysdep.h"         /* calloc */
 
 #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"
 
 /* Create a log channel to have nice outputs. */
 #include "xbt/log.h"
index 5f0a615..7c3c44b 100644 (file)
@@ -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.
  *
  * 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 <tt>break;</tt>
+ * 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_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:
 
 /* 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
  */
 
  *  - sending such beasts over the network
  */
 
-#include "xbt/synchro_core.h"
 typedef struct xbt_dynar_s {
   unsigned long size;
   unsigned long used;
 typedef struct xbt_dynar_s {
   unsigned long size;
   unsigned long used;
index 35acc6f..cbccf4c 100644 (file)
@@ -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.    */
 
 /* 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"
 
 #include "jmsg_synchro.h"
 #include "jxbt_utilities.h"
 
index 8c7cd9f..6924f0b 100644 (file)
@@ -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)
 {
  */
 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);
 }
 
   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 */
                                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.
 }
 
 /** @brief Mark the last dynar's element as unused and return a pointer to it.
index ac2fa9b..f383208 100644 (file)
@@ -46,6 +46,7 @@
 #include "portable.h"           /* execinfo when available */
 #include "xbt/ex.h"
 #include "xbt/str.h"
 #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"
 #include "xbt_modinter.h"       /* backtrace initialization headers */
 
 #include "xbt/ex_interface.h"
index 9801a74..bbe1cb1 100644 (file)
@@ -7,6 +7,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "portable.h"           /* execinfo when available */
  * 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"
 #include "xbt/ex_interface.h"
 #include "xbt/sysdep.h"
 #include "xbt/strbuff.h"
index 6dc3c95..78e578c 100644 (file)
@@ -11,6 +11,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 #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,
 
 #include "xbt/queue.h"          /* this module */
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_queue, xbt,
index f0f87ef..ae49355 100644 (file)
@@ -10,6 +10,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/ex.h"
  * 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 */
 
 #include "simgrid/simix.h"        /* used implementation */
 #include "../simix/smx_private.h" /* FIXME */
index d888d84..0d20b02 100644 (file)
@@ -10,6 +10,7 @@
 #define TESH_RUN_CONTEXT_H
 
 #include "tesh.h"
 #define TESH_RUN_CONTEXT_H
 
 #include "tesh.h"
+#include "xbt/synchro_core.h"
 
 typedef enum { e_output_check, e_output_display,
   e_output_ignore
 
 typedef enum { e_output_check, e_output_display,
   e_output_ignore