#include <glib.h>
#include <pthread.h>
-#include "mono/io-layer/wapi.h"
+#include <mono/io-layer/wapi.h>
+#include <mono/io-layer/critical-section-private.h>
#include "mono-mutex.h"
g_assert (ret == 0);
}
+void _wapi_critical_section_cleanup (void)
+{
+ mono_mutexattr_destroy (&attr);
+}
+
/**
* InitializeCriticalSection:
* @section: The critical section to initialise
}
}
-/**
- * EnterCriticalSection:
- * @section: The critical section to enter
- *
- * Enters critical section @section, blocking while other threads own
- * it. This function doesn't return until the calling thread assumes
- * ownership of @section.
- *
- * A thread can recursively call EnterCriticalSection() and
- * TryEnterCriticalSection(), but must call LeaveCriticalSection() an
- * equal number of times.
- */
-void EnterCriticalSection(WapiCriticalSection *section)
-{
- int stat;
-
- if ((stat = mono_mutex_lock(§ion->mutex)) != 0) {
- g_error ("%s: EnterCriticalSection failed: %s", __func__,
- g_strerror(stat));
- }
-}
-
-/**
- * LeaveCriticalSection:
- * @section: The critical section to leave
- *
- * Leaves critical section @section, relinquishing ownership.
- *
- * A thread can recursively call EnterCriticalSection() and
- * TryEnterCriticalSection(), but must call LeaveCriticalSection() an
- * equal number of times.
- */
-void LeaveCriticalSection(WapiCriticalSection *section)
-{
- int ret;
-
- ret = mono_mutex_unlock(§ion->mutex);
- g_assert (ret == 0);
-}
-