#ifndef _WAPI_CRITICAL_SECTIONS_H_
#define _WAPI_CRITICAL_SECTIONS_H_
+#include <config.h>
+
#include <glib.h>
#include <pthread.h>
+#include "mono-mutex.h"
+
typedef struct _WapiCriticalSection WapiCriticalSection;
struct _WapiCriticalSection
{
guint32 depth;
- pthread_mutex_t mutex;
+ mono_mutex_t mutex;
};
extern void InitializeCriticalSection(WapiCriticalSection *section);
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <assert.h>
#include "mono-mutex.h"
if (pthread_mutex_lock (&mutex->mutex) != 0)
return EINVAL;
- g_assert (mutex->owner == pthread_self ());
+ assert (mutex->owner == pthread_self ());
mutex->depth--;
if (mutex->depth == 0) {
int
mono_cond_timedwait (pthread_cond_t *cond, mono_mutex_t *mutex, const struct timespec *timeout)
{
- return pthread_cond_wait (cond, &mutex->mutex, timeout);
+ return pthread_cond_timedwait (cond, &mutex->mutex, timeout);
}
#endif /* USE_MONO_MUTEX */
#include <glib.h>
#include <pthread.h>
+#include "mono-mutex.h"
+
typedef struct
{
pthread_t id;
- pthread_mutex_t join_mutex;
+ mono_mutex_t join_mutex;
pthread_cond_t exit_cond;
guint32 (*start_routine)(gpointer arg);
void (*exit_routine)(guint32 exitstatus, gpointer userdata);
/* This is an internal, private header file */
+#include <config.h>
+
#include <glib.h>
#include <pthread.h>
#include <semaphore.h>
#include "wapi-private.h"
#include "timed-thread.h"
+#include "mono-mutex.h"
+
typedef enum {
WQ_NEW,
WQ_WAITING,
typedef struct _WaitQueueItem
{
- pthread_mutex_t mutex;
+ mono_mutex_t mutex;
sem_t wait_sem;
WaitQueueState state;
guint32 update, ack;