projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a pkg-config file for the new liburcu-cds
[urcu.git]
/
urcu.c
diff --git
a/urcu.c
b/urcu.c
index 5a9c2f0ae761d9a4d7cd97ed7af4bfc42998edb7..ccaf3e95a2d5ad6f7428625b399429cd843344b6 100644
(file)
--- a/
urcu.c
+++ b/
urcu.c
@@
-24,6
+24,7
@@
*/
#define _BSD_SOURCE
*/
#define _BSD_SOURCE
+#define _GNU_SOURCE
#include <stdio.h>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <pthread.h>
#include <signal.h>
@@
-33,7
+34,9
@@
#include <errno.h>
#include <poll.h>
#include <errno.h>
#include <poll.h>
-#include "urcu-static.h"
+#include "urcu/map/urcu.h"
+
+#include "urcu/static/urcu.h"
/* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
#include "urcu.h"
/* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
#include "urcu.h"
@@
-99,9
+102,9
@@
static void mutex_lock(pthread_mutex_t *mutex)
perror("Error in pthread mutex lock");
exit(-1);
}
perror("Error in pthread mutex lock");
exit(-1);
}
- if (C
AA
_LOAD_SHARED(rcu_reader.need_mb)) {
+ if (C
MM
_LOAD_SHARED(rcu_reader.need_mb)) {
cmm_smp_mb();
cmm_smp_mb();
- _C
AA
_STORE_SHARED(rcu_reader.need_mb, 0);
+ _C
MM
_STORE_SHARED(rcu_reader.need_mb, 0);
cmm_smp_mb();
}
poll(NULL,0,10);
cmm_smp_mb();
}
poll(NULL,0,10);
@@
-155,7
+158,7
@@
static void force_mb_all_readers(void)
* cache flush is enforced.
*/
cds_list_for_each_entry(index, ®istry, node) {
* cache flush is enforced.
*/
cds_list_for_each_entry(index, ®istry, node) {
- C
AA
_STORE_SHARED(index->need_mb, 1);
+ C
MM
_STORE_SHARED(index->need_mb, 1);
pthread_kill(index->tid, SIGRCU);
}
/*
pthread_kill(index->tid, SIGRCU);
}
/*
@@
-172,7
+175,7
@@
static void force_mb_all_readers(void)
* the Linux Test Project (LTP).
*/
cds_list_for_each_entry(index, ®istry, node) {
* the Linux Test Project (LTP).
*/
cds_list_for_each_entry(index, ®istry, node) {
- while (C
AA
_LOAD_SHARED(index->need_mb)) {
+ while (C
MM
_LOAD_SHARED(index->need_mb)) {
pthread_kill(index->tid, SIGRCU);
poll(NULL, 0, 1);
}
pthread_kill(index->tid, SIGRCU);
poll(NULL, 0, 1);
}
@@
-205,7
+208,7
@@
void update_counter_and_wait(void)
struct rcu_reader *index, *tmp;
/* Switch parity: 0 -> 1, 1 -> 0 */
struct rcu_reader *index, *tmp;
/* Switch parity: 0 -> 1, 1 -> 0 */
- C
AA
_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE);
+ C
MM
_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE);
/*
* Must commit rcu_gp_ctr update to memory before waiting for quiescent
/*
* Must commit rcu_gp_ctr update to memory before waiting for quiescent
@@
-384,7
+387,7
@@
static void sigrcu_handler(int signo, siginfo_t *siginfo, void *context)
* executed on.
*/
cmm_smp_mb();
* executed on.
*/
cmm_smp_mb();
- _C
AA
_STORE_SHARED(rcu_reader.need_mb, 0);
+ _C
MM
_STORE_SHARED(rcu_reader.need_mb, 0);
cmm_smp_mb();
}
cmm_smp_mb();
}
@@
-428,4
+431,8
@@
void rcu_exit(void)
assert(act.sa_sigaction == sigrcu_handler);
assert(cds_list_empty(®istry));
}
assert(act.sa_sigaction == sigrcu_handler);
assert(cds_list_empty(®istry));
}
+
#endif /* #ifdef RCU_SIGNAL */
#endif /* #ifdef RCU_SIGNAL */
+
+#include "urcu-call-rcu-impl.h"
+#include "urcu-defer-impl.h"
This page took
0.024919 seconds
and
4
git commands to generate.