The sd-hwdb objects cannot be used concurrently from two threads in any
meaningful way, because query and iteration operations modify the object.
Thus atomic reference counts are pointless.
#include "hashmap.h"
#include "hwdb-internal.h"
#include "hwdb-util.h"
-#include "refcnt.h"
#include "string-util.h"
#include "util.h"
struct sd_hwdb {
- RefCount n_ref;
+ unsigned n_ref;
FILE *f;
struct stat st;
if (!hwdb)
return -ENOMEM;
- hwdb->n_ref = REFCNT_INIT;
+ hwdb->n_ref = 1;
/* find hwdb.bin in hwdb_bin_paths */
NULSTR_FOREACH(hwdb_bin_path, hwdb_bin_paths) {
return mfree(hwdb);
}
-DEFINE_PUBLIC_ATOMIC_REF_UNREF_FUNC(sd_hwdb, sd_hwdb, hwdb_free)
+DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC(sd_hwdb, sd_hwdb, hwdb_free)
bool hwdb_validate(sd_hwdb *hwdb) {
bool found = false;