projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Install urcu/map/*.h into system
[urcu.git]
/
urcu-qsbr-static.h
diff --git
a/urcu-qsbr-static.h
b/urcu-qsbr-static.h
index 8822e050bac8aaa00a8c210dfb122193f2e90280..e0b12be15c2ebdf540446dbbaa16cdce8ff5f4fe 100644
(file)
--- a/
urcu-qsbr-static.h
+++ b/
urcu-qsbr-static.h
@@
-9,7
+9,7
@@
* TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu-qsbr.h for linking
* dynamically with the userspace rcu QSBR library.
*
* TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu-qsbr.h for linking
* dynamically with the userspace rcu QSBR library.
*
- * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@
polymtl.ca
>
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@
efficios.com
>
* Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
*
* This library is free software; you can redistribute it and/or
* Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
*
* This library is free software; you can redistribute it and/or
@@
-135,7
+135,7
@@
struct rcu_reader {
/* Data used by both reader and synchronize_rcu() */
unsigned long ctr;
/* Data used for registry */
/* Data used by both reader and synchronize_rcu() */
unsigned long ctr;
/* Data used for registry */
- struct
list_head node __attribute__((aligned(
CACHE_LINE_SIZE)));
+ struct
cds_list_head node __attribute__((aligned(CAA_
CACHE_LINE_SIZE)));
pthread_t tid;
};
pthread_t tid;
};
@@
-155,23
+155,13
@@
static inline void wake_up_gp(void)
}
}
}
}
-#if (BITS_PER_LONG < 64)
static inline int rcu_gp_ongoing(unsigned long *ctr)
{
unsigned long v;
static inline int rcu_gp_ongoing(unsigned long *ctr)
{
unsigned long v;
- v = LOAD_SHARED(*ctr);
- return v && (
(v ^ rcu_gp_ctr) & RCU_GP_CTR
);
+ v =
CMM_
LOAD_SHARED(*ctr);
+ return v && (
v != rcu_gp_ctr
);
}
}
-#else /* !(BITS_PER_LONG < 64) */
-static inline int rcu_gp_ongoing(unsigned long *ctr)
-{
- unsigned long v;
-
- v = LOAD_SHARED(*ctr);
- return v && (v - rcu_gp_ctr > ULONG_MAX / 2);
-}
-#endif /* !(BITS_PER_LONG < 64) */
static inline void _rcu_read_lock(void)
{
static inline void _rcu_read_lock(void)
{
@@
-184,25
+174,27
@@
static inline void _rcu_read_unlock(void)
static inline void _rcu_quiescent_state(void)
{
static inline void _rcu_quiescent_state(void)
{
- smp_mb();
- _
STORE_SHARED(rcu_reader.ctr,
_LOAD_SHARED(rcu_gp_ctr));
-
smp_mb();
/* write rcu_reader.ctr before read futex */
+ cmm_smp_mb();
+ _
CMM_STORE_SHARED(rcu_reader.ctr, _CMM
_LOAD_SHARED(rcu_gp_ctr));
+
cmm_smp_mb();
/* write rcu_reader.ctr before read futex */
wake_up_gp();
wake_up_gp();
- smp_mb();
+
cmm_
smp_mb();
}
static inline void _rcu_thread_offline(void)
{
}
static inline void _rcu_thread_offline(void)
{
- smp_mb();
- STORE_SHARED(rcu_reader.ctr, 0);
-
smp_mb();
/* write rcu_reader.ctr before read futex */
+
cmm_
smp_mb();
+
CMM_
STORE_SHARED(rcu_reader.ctr, 0);
+
cmm_smp_mb();
/* write rcu_reader.ctr before read futex */
wake_up_gp();
wake_up_gp();
+ cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
}
static inline void _rcu_thread_online(void)
{
}
static inline void _rcu_thread_online(void)
{
- _STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
- smp_mb();
+ cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
+ _CMM_STORE_SHARED(rcu_reader.ctr, CMM_LOAD_SHARED(rcu_gp_ctr));
+ cmm_smp_mb();
}
#ifdef __cplusplus
}
#ifdef __cplusplus
This page took
0.025618 seconds
and
4
git commands to generate.