Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Drop xbt_os_mutex_* functions.
[simgrid.git] / src / kernel / context / ContextThread.hpp
index 5024b6f..4c76ae2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2019. 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. */
@@ -11,7 +11,8 @@
 #include "simgrid/simix.hpp"
 #include "src/kernel/context/Context.hpp"
 #include "src/xbt/OsSemaphore.hpp"
-#include "xbt/xbt_os_thread.h"
+
+#include <thread>
 
 namespace simgrid {
 namespace kernel {
@@ -32,7 +33,7 @@ public:
 
 private:
   /** A portable thread */
-  xbt_os_thread_t thread_ = nullptr;
+  std::thread* thread_ = nullptr;
   /** Semaphore used to schedule/yield the process (not needed when the maestro is in main, but harmless then) */
   xbt::OsSemaphore begin_{0};
   /** Semaphore used to schedule/unschedule (not needed when the maestro is in main, but harmless then) */
@@ -87,7 +88,6 @@ public:
     return create_context(std::move(code), cleanup_func, process, maestro);
   }
   void run_all() override;
-  ThreadContext* self() override { return static_cast<ThreadContext*>(xbt_os_thread_get_extra_data()); }
 
   // Optional methods:
   ThreadContext* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process) override