projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test C++ build of list head init
[userspace-rcu.git]
/
src
/
urcu-defer-impl.h
diff --git
a/src/urcu-defer-impl.h
b/src/urcu-defer-impl.h
index b2e1b3cab6c72428c138e45fb800ebdedd0e0a53..d25e9b93f4dc17e8f1e6ee986ad04cdca366527f 100644
(file)
--- a/
src/urcu-defer-impl.h
+++ b/
src/urcu-defer-impl.h
@@
-33,7
+33,6
@@
#include <pthread.h>
#include <stdio.h>
#include <signal.h>
#include <pthread.h>
#include <stdio.h>
#include <signal.h>
-#include <assert.h>
#include <string.h>
#include <errno.h>
#include <poll.h>
#include <string.h>
#include <errno.h>
#include <poll.h>
@@
-43,6
+42,7
@@
#include "urcu/futex.h"
#include "urcu/futex.h"
+#include <urcu/assert.h>
#include <urcu/compiler.h>
#include <urcu/arch.h>
#include <urcu/uatomic.h>
#include <urcu/compiler.h>
#include <urcu/arch.h>
#include <urcu/uatomic.h>
@@
-50,6
+50,7
@@
#include <urcu/system.h>
#include <urcu/tls-compat.h>
#include "urcu-die.h"
#include <urcu/system.h>
#include <urcu/tls-compat.h>
#include "urcu-die.h"
+#include "urcu-utils.h"
/*
* Number of entries in the per-thread defer queue. Must be power of 2.
/*
* Number of entries in the per-thread defer queue. Must be power of 2.
@@
-107,7
+108,7
@@
struct defer_queue {
};
/* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
};
/* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
-#include
"urcu-defer.h"
+#include
<urcu/defer.h>
void __attribute__((destructor)) rcu_defer_exit(void);
void __attribute__((destructor)) rcu_defer_exit(void);
@@
-126,7
+127,7
@@
static int32_t defer_thread_stop;
* Written to only by each individual deferer. Read by both the deferer and
* the reclamation tread.
*/
* Written to only by each individual deferer. Read by both the deferer and
* the reclamation tread.
*/
-static DEFINE_URCU_TLS
_IE
(struct defer_queue, defer_queue);
+static DEFINE_URCU_TLS(struct defer_queue, defer_queue);
static CDS_LIST_HEAD(registry_defer);
static pthread_t tid_defer;
static CDS_LIST_HEAD(registry_defer);
static pthread_t tid_defer;
@@
-324,9
+325,9
@@
static void _defer_rcu(void (*fct)(void *p), void *p)
* Worse-case: must allow 2 supplementary entries for fct pointer.
*/
if (caa_unlikely(head - tail >= DEFER_QUEUE_SIZE - 2)) {
* Worse-case: must allow 2 supplementary entries for fct pointer.
*/
if (caa_unlikely(head - tail >= DEFER_QUEUE_SIZE - 2)) {
- assert(head - tail <= DEFER_QUEUE_SIZE);
+
urcu_posix_
assert(head - tail <= DEFER_QUEUE_SIZE);
rcu_defer_barrier_thread();
rcu_defer_barrier_thread();
- assert(head - CMM_LOAD_SHARED(URCU_TLS(defer_queue).tail) == 0);
+
urcu_posix_
assert(head - CMM_LOAD_SHARED(URCU_TLS(defer_queue).tail) == 0);
}
/*
}
/*
@@
-371,7
+372,7
@@
static void _defer_rcu(void (*fct)(void *p), void *p)
wake_up_defer();
}
wake_up_defer();
}
-static void *thr_defer(void *args)
+static void *thr_defer(void *args
__attribute__((unused))
)
{
for (;;) {
/*
{
for (;;) {
/*
@@
-402,7
+403,7
@@
static void start_defer_thread(void)
int ret;
ret = pthread_create(&tid_defer, NULL, thr_defer, NULL);
int ret;
ret = pthread_create(&tid_defer, NULL, thr_defer, NULL);
- assert(!ret);
+
urcu_posix_
assert(!ret);
}
static void stop_defer_thread(void)
}
static void stop_defer_thread(void)
@@
-416,19
+417,19
@@
static void stop_defer_thread(void)
wake_up_defer();
ret = pthread_join(tid_defer, &tret);
wake_up_defer();
ret = pthread_join(tid_defer, &tret);
- assert(!ret);
+
urcu_posix_
assert(!ret);
CMM_STORE_SHARED(defer_thread_stop, 0);
/* defer thread should always exit when futex value is 0 */
CMM_STORE_SHARED(defer_thread_stop, 0);
/* defer thread should always exit when futex value is 0 */
- assert(uatomic_read(&defer_thread_futex) == 0);
+
urcu_posix_
assert(uatomic_read(&defer_thread_futex) == 0);
}
int rcu_defer_register_thread(void)
{
int was_empty;
}
int rcu_defer_register_thread(void)
{
int was_empty;
- assert(URCU_TLS(defer_queue).last_head == 0);
- assert(URCU_TLS(defer_queue).q == NULL);
+
urcu_posix_
assert(URCU_TLS(defer_queue).last_head == 0);
+
urcu_posix_
assert(URCU_TLS(defer_queue).q == NULL);
URCU_TLS(defer_queue).q = malloc(sizeof(void *) * DEFER_QUEUE_SIZE);
if (!URCU_TLS(defer_queue).q)
return -ENOMEM;
URCU_TLS(defer_queue).q = malloc(sizeof(void *) * DEFER_QUEUE_SIZE);
if (!URCU_TLS(defer_queue).q)
return -ENOMEM;
@@
-465,7
+466,7
@@
void rcu_defer_unregister_thread(void)
void rcu_defer_exit(void)
{
void rcu_defer_exit(void)
{
- assert(cds_list_empty(®istry_defer));
+
urcu_posix_
assert(cds_list_empty(®istry_defer));
}
#endif /* _URCU_DEFER_IMPL_H */
}
#endif /* _URCU_DEFER_IMPL_H */
This page took
0.024408 seconds
and
4
git commands to generate.