static int gcpufreq_count = 0;
static struct list_head gcpufreq_list;
-pipe_static_mutex(gcpufreq_mutex);
+static mtx_t gcpufreq_mutex = _MTX_INITIALIZER_NP;
static struct cpufreq_info *
find_cfi_by_index(int cpu_index, int mode)
int cpu_index;
/* Return the number of CPU metrics we support. */
- pipe_mutex_lock(gcpufreq_mutex);
+ mtx_lock(&gcpufreq_mutex);
if (gcpufreq_count) {
- pipe_mutex_unlock(gcpufreq_mutex);
+ mtx_unlock(&gcpufreq_mutex);
return gcpufreq_count;
}
list_inithead(&gcpufreq_list);
DIR *dir = opendir("/sys/devices/system/cpu");
if (!dir) {
- pipe_mutex_unlock(gcpufreq_mutex);
+ mtx_unlock(&gcpufreq_mutex);
return 0;
}
}
}
- pipe_mutex_unlock(gcpufreq_mutex);
+ mtx_unlock(&gcpufreq_mutex);
return gcpufreq_count;
}