Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Disable sthread at the end of the sthread_main
[simgrid.git] / src / sthread / sthread.h
index 233dbb1..9bc6c50 100644 (file)
@@ -7,12 +7,23 @@
  *
  * The sthread_* symbols are those actual implementations, used in the pthread_* redefinitions. */
 
+#ifndef SIMGRID_STHREAD_H
+#define SIMGRID_STHREAD_H
+
+#if defined(__ELF__)
+#define XBT_PUBLIC __attribute__((visibility("default")))
+#else
+#define XBT_PUBLIC
+#endif
+
 #if defined(__cplusplus)
 extern "C" {
 #endif
-extern volatile int sthread_inside_simgrid; // Only intercept pthread calls in user code
 
+// Launch the simulation. The old main function (passed as a parameter) is launched as an actor
 int sthread_main(int argc, char** argv, char** envp, int (*raw_main)(int, char**, char**));
+XBT_PUBLIC void sthread_enable(void);  // Start intercepting all pthread calls
+XBT_PUBLIC void sthread_disable(void); // Stop intercepting all pthread calls
 
 typedef unsigned long int sthread_t;
 int sthread_create(sthread_t* thread, const /*pthread_attr_t*/ void* attr, void* (*start_routine)(void*), void* arg);
@@ -30,3 +41,5 @@ int sthread_mutex_destroy(sthread_mutex_t* mutex);
 #if defined(__cplusplus)
 }
 #endif
+
+#endif
\ No newline at end of file