/* 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/function_types.h"
-#include "xbt/misc.h" /* SG_BEGIN_DECL */
+#include "simgrid/cond.h"
+#include "simgrid/mutex.h"
+#include <xbt/misc.h> /* SG_BEGIN_DECL */
/** @brief Tries to block onto the given mutex variable
* Tries to lock a mutex, return 1 if the mutex is unlocked, else 0.
* This function does not block and wait for the mutex to be unlocked.
/** @brief Tries to block onto the given mutex variable
* Tries to lock a mutex, return 1 if the mutex is unlocked, else 0.
* This function does not block and wait for the mutex to be unlocked.
- * \param mutex The mutex
- * \return 1 - mutex free, 0 - mutex used
+ * @param mutex The mutex
+ * @return 1 - mutex free, 0 - mutex used
-/** @brief Destroyes the given mutex variable */
-XBT_PUBLIC void xbt_mutex_destroy(xbt_mutex_t mutex);
+/** @brief Destroys the given mutex variable */
+XBT_ATTRIB_DEPRECATED_v328("Please use sg_mutex_destroy") static inline void xbt_mutex_destroy(xbt_mutex_t mutex)
+{
+ sg_mutex_destroy(mutex);
+}
-XBT_PUBLIC void xbt_cond_wait(xbt_cond_t cond, xbt_mutex_t mutex);
+XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_wait") static inline void xbt_cond_wait(xbt_cond_t cond,
+ xbt_mutex_t mutex)
+{
+ sg_cond_wait(cond, mutex);
+}
+
/** @brief Blocks onto the given condition variable, but only for the given amount of time.
* @return 0 on success, 1 on timeout */
/** @brief Blocks onto the given condition variable, but only for the given amount of time.
* @return 0 on success, 1 on timeout */
-XBT_PUBLIC int xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay);
+XBT_ATTRIB_DEPRECATED_v328("Please use sg_cond_wait_for") static inline int xbt_cond_timedwait(xbt_cond_t cond,
+ xbt_mutex_t mutex,
+ double delay)
+{
+ return sg_cond_wait_for(cond, mutex, delay);
+}
+