X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=rculfhash.c;h=6a41b92fa5fb11e3630e56f47ef161c0e4e6ca0f;hp=19767096d20b0f3e840059596a7ea0ec4673c30f;hb=a47dd11cc003c264dccfa9541e7974690e724037;hpb=67ecffc0f530a7b5c4dd5111ea7dd3213da8eb91 diff --git a/rculfhash.c b/rculfhash.c index 1976709..6a41b92 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -266,6 +266,7 @@ #include #include "config.h" +#include "compat-getcpu.h" #include #include #include @@ -619,26 +620,18 @@ void free_split_items_count(struct cds_lfht *ht) poison_free(ht->split_count); } -#if defined(HAVE_SCHED_GETCPU) static int ht_get_split_count_index(unsigned long hash) { int cpu; assert(split_count_mask >= 0); - cpu = sched_getcpu(); + cpu = urcu_sched_getcpu(); if (caa_unlikely(cpu < 0)) return hash & split_count_mask; else return cpu & split_count_mask; } -#else /* #if defined(HAVE_SCHED_GETCPU) */ -static -int ht_get_split_count_index(unsigned long hash) -{ - return hash & split_count_mask; -} -#endif /* #else #if defined(HAVE_SCHED_GETCPU) */ static void ht_count_add(struct cds_lfht *ht, unsigned long size, unsigned long hash)