+/**
+ * \brief Returns the current context of this thread.
+ * \return the current context of this thread
+ */
+XBT_INLINE smx_context_t SIMIX_context_get_current(void)
+{
+#ifdef HAVE_THREAD_LOCAL_STORAGE
+ return smx_current_context;
+#else
+ return xbt_os_thread_get_specific(smx_current_context_key);
+#endif
+}
+
+/**
+ * \brief Sets the current context of this thread.
+ * \param context the context to set
+ */
+XBT_INLINE void SIMIX_context_set_current(smx_context_t context)
+{
+#ifdef HAVE_THREAD_LOCAL_STORAGE
+ smx_current_context = context;
+#else
+ xbt_os_thread_set_specific(smx_current_context_key, context);
+#endif
+}
+