#include "vdpau_private.h"
static struct handle_table *htab = NULL;
-pipe_static_mutex(htab_lock);
+static mtx_t htab_lock = _MTX_INITIALIZER_NP;
boolean vlCreateHTAB(void)
{
/* Make sure handle table handles match VDPAU handles. */
assert(sizeof(unsigned) <= sizeof(vlHandle));
- pipe_mutex_lock(htab_lock);
+ mtx_lock(&htab_lock);
if (!htab)
htab = handle_table_create();
ret = htab != NULL;
- pipe_mutex_unlock(htab_lock);
+ mtx_unlock(&htab_lock);
return ret;
}
void vlDestroyHTAB(void)
{
- pipe_mutex_lock(htab_lock);
+ mtx_lock(&htab_lock);
if (htab && !handle_table_get_first_handle(htab)) {
handle_table_destroy(htab);
htab = NULL;
}
- pipe_mutex_unlock(htab_lock);
+ mtx_unlock(&htab_lock);
}
vlHandle vlAddDataHTAB(void *data)
vlHandle handle = 0;
assert(data);
- pipe_mutex_lock(htab_lock);
+ mtx_lock(&htab_lock);
if (htab)
handle = handle_table_add(htab, data);
- pipe_mutex_unlock(htab_lock);
+ mtx_unlock(&htab_lock);
return handle;
}
void *data = NULL;
assert(handle);
- pipe_mutex_lock(htab_lock);
+ mtx_lock(&htab_lock);
if (htab)
data = handle_table_get(htab, handle);
- pipe_mutex_unlock(htab_lock);
+ mtx_unlock(&htab_lock);
return data;
}
void vlRemoveDataHTAB(vlHandle handle)
{
- pipe_mutex_lock(htab_lock);
+ mtx_lock(&htab_lock);
if (htab)
handle_table_remove(htab, handle);
- pipe_mutex_unlock(htab_lock);
+ mtx_unlock(&htab_lock);
}