#include "hud/hud_private.h"
#include "util/list.h"
#include "util/os_time.h"
+#include "util/simple_mtx.h"
#include "util/u_thread.h"
#include "util/u_memory.h"
#include "util/u_string.h"
*/
static int gnic_count = 0;
static struct list_head gnic_list;
-static mtx_t gnic_mutex = _MTX_INITIALIZER_NP;
+static simple_mtx_t gnic_mutex = SIMPLE_MTX_INITIALIZER;
static struct nic_info *
find_nic_by_name(const char *n, int mode)
char name[64];
/* Return the number if network interfaces. */
- mtx_lock(&gnic_mutex);
+ simple_mtx_lock(&gnic_mutex);
if (gnic_count) {
- mtx_unlock(&gnic_mutex);
+ simple_mtx_unlock(&gnic_mutex);
return gnic_count;
}
list_inithead(&gnic_list);
DIR *dir = opendir("/sys/class/net/");
if (!dir) {
- mtx_unlock(&gnic_mutex);
+ simple_mtx_unlock(&gnic_mutex);
return 0;
}
}
- mtx_unlock(&gnic_mutex);
+ simple_mtx_unlock(&gnic_mutex);
return gnic_count;
}