projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename all data structure with prefix cds_
[userspace-rcu.git]
/
urcu-bp.c
diff --git
a/urcu-bp.c
b/urcu-bp.c
index b457d2bc8f6e49fee5b55565107219aaf02d6ee9..136f97d3cf6746eef6d39a9f2a22ca1139a342fc 100644
(file)
--- a/
urcu-bp.c
+++ b/
urcu-bp.c
@@
-66,7
+66,7
@@
long rcu_gp_ctr = RCU_GP_COUNT;
*/
struct rcu_reader __thread *rcu_reader;
*/
struct rcu_reader __thread *rcu_reader;
-static LIST_HEAD(registry);
+static
CDS_
LIST_HEAD(registry);
struct registry_arena {
void *p;
struct registry_arena {
void *p;
@@
-118,7
+118,7
@@
static void mutex_unlock(pthread_mutex_t *mutex)
void update_counter_and_wait(void)
{
void update_counter_and_wait(void)
{
- LIST_HEAD(qsreaders);
+
CDS_
LIST_HEAD(qsreaders);
int wait_loops = 0;
struct rcu_reader *index, *tmp;
int wait_loops = 0;
struct rcu_reader *index, *tmp;
@@
-144,12
+144,12
@@
void update_counter_and_wait(void)
*/
for (;;) {
wait_loops++;
*/
for (;;) {
wait_loops++;
- list_for_each_entry_safe(index, tmp, ®istry, node) {
+
cds_
list_for_each_entry_safe(index, tmp, ®istry, node) {
if (!rcu_old_gp_ongoing(&index->ctr))
if (!rcu_old_gp_ongoing(&index->ctr))
- list_move(&index->node, &qsreaders);
+
cds_
list_move(&index->node, &qsreaders);
}
}
- if (list_empty(®istry)) {
+ if (
cds_
list_empty(®istry)) {
break;
} else {
if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS)
break;
} else {
if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS)
@@
-159,7
+159,7
@@
void update_counter_and_wait(void)
}
}
/* put back the reader list in the registry */
}
}
/* put back the reader list in the registry */
- list_splice(&qsreaders, ®istry);
+
cds_
list_splice(&qsreaders, ®istry);
}
void synchronize_rcu(void)
}
void synchronize_rcu(void)
@@
-174,7
+174,7
@@
void synchronize_rcu(void)
mutex_lock(&rcu_gp_lock);
mutex_lock(&rcu_gp_lock);
- if (list_empty(®istry))
+ if (
cds_
list_empty(®istry))
goto out;
/* All threads should read qparity before accessing data structure
goto out;
/* All threads should read qparity before accessing data structure
@@
-279,7
+279,7
@@
static void add_thread(void)
/* Add to registry */
rcu_reader_reg->tid = pthread_self();
assert(rcu_reader_reg->ctr == 0);
/* Add to registry */
rcu_reader_reg->tid = pthread_self();
assert(rcu_reader_reg->ctr == 0);
- list_add(&rcu_reader_reg->node, ®istry);
+
cds_
list_add(&rcu_reader_reg->node, ®istry);
rcu_reader = rcu_reader_reg;
}
rcu_reader = rcu_reader_reg;
}
@@
-299,7
+299,7
@@
static void rcu_gc_registry(void)
ret = pthread_kill(tid, 0);
assert(ret != EINVAL);
if (ret == ESRCH) {
ret = pthread_kill(tid, 0);
assert(ret != EINVAL);
if (ret == ESRCH) {
- list_del(&rcu_reader_reg->node);
+
cds_
list_del(&rcu_reader_reg->node);
rcu_reader_reg->ctr = 0;
rcu_reader_reg->alloc = 0;
registry_arena.used -= sizeof(struct rcu_reader);
rcu_reader_reg->ctr = 0;
rcu_reader_reg->alloc = 0;
registry_arena.used -= sizeof(struct rcu_reader);
This page took
0.025898 seconds
and
4
git commands to generate.