#include "util/anon_file.h"
#include "util/set.h"
+#include "util/simple_mtx.h"
#include "util/u_debug.h"
#include "drm_shim.h"
#define REAL_FUNCTION_POINTER(x) __typeof__(x) *real_##x
-static mtx_t shim_lock = _MTX_INITIALIZER_NP;
+static simple_mtx_t shim_lock = SIMPLE_MTX_INITIALIZER;
struct set *opendir_set;
bool drm_shim_debug;
dir = fake_dev_dri;
}
- mtx_lock(&shim_lock);
+ simple_mtx_lock(&shim_lock);
_mesa_set_add(opendir_set, dir);
- mtx_unlock(&shim_lock);
+ simple_mtx_unlock(&shim_lock);
}
return dir;
static struct dirent render_node_dirent = { 0 };
- mtx_lock(&shim_lock);
+ simple_mtx_lock(&shim_lock);
if (_mesa_set_search(opendir_set, dir)) {
strcpy(render_node_dirent.d_name,
render_node_dirent_name);
ent = &render_node_dirent;
_mesa_set_remove_key(opendir_set, dir);
}
- mtx_unlock(&shim_lock);
+ simple_mtx_unlock(&shim_lock);
if (!ent && dir != fake_dev_dri)
ent = real_readdir(dir);
static struct dirent64 render_node_dirent = { 0 };
- mtx_lock(&shim_lock);
+ simple_mtx_lock(&shim_lock);
if (_mesa_set_search(opendir_set, dir)) {
strcpy(render_node_dirent.d_name,
render_node_dirent_name);
ent = &render_node_dirent;
_mesa_set_remove_key(opendir_set, dir);
}
- mtx_unlock(&shim_lock);
+ simple_mtx_unlock(&shim_lock);
if (!ent && dir != fake_dev_dri)
ent = real_readdir64(dir);
{
init_shim();
- mtx_lock(&shim_lock);
+ simple_mtx_lock(&shim_lock);
_mesa_set_remove_key(opendir_set, dir);
- mtx_unlock(&shim_lock);
+ simple_mtx_unlock(&shim_lock);
if (dir != fake_dev_dri)
return real_closedir(dir);