summaryrefslogtreecommitdiffstats
path: root/testsuite/epoch01/test_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/epoch01/test_main.c')
-rw-r--r--testsuite/epoch01/test_main.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/testsuite/epoch01/test_main.c b/testsuite/epoch01/test_main.c
index 7088a126..b72431de 100644
--- a/testsuite/epoch01/test_main.c
+++ b/testsuite/epoch01/test_main.c
@@ -357,6 +357,51 @@ test_enter_list_op_exit_preempt_fini(rtems_test_parallel_context *base,
}
static void
+test_enter_list_op_exit_drain_body(rtems_test_parallel_context *base,
+ void *arg, size_t active_workers, size_t worker_index)
+{
+ test_context *ctx;
+ epoch_t e;
+ uint32_t counter;
+ uint32_t removals;
+ uint32_t item_counter[CPU_COUNT];
+
+ ctx = (test_context *)base;
+ e = global_epoch;
+ counter = 0;
+ removals = 0;
+ memset(item_counter, 0, sizeof(item_counter));
+
+ while (!rtems_test_parallel_stop_job(&ctx->base)) {
+ test_item *rm;
+
+ epoch_enter(e);
+ ++counter;
+ rm = test_remove_item(ctx, item_counter, &removals,
+ worker_index);
+ epoch_exit(e);
+
+ if (rm != NULL) {
+ epoch_call(e, &rm->ec, test_list_callback);
+ epoch_drain_callbacks(e);
+ }
+ }
+
+ ctx->stats.counter[worker_index] = counter;
+ ctx->stats.removals[worker_index] = removals;
+ memcpy(ctx->stats.item_counter[worker_index], item_counter,
+ sizeof(ctx->stats.item_counter[worker_index]));
+}
+
+static void
+test_enter_list_op_exit_drain_fini(rtems_test_parallel_context *base,
+ void *arg, size_t active_workers)
+{
+
+ test_fini(base, "EnterListOpExitDrain", active_workers);
+}
+
+static void
test_thread_local_mutex_body(rtems_test_parallel_context *base, void *arg,
size_t active_workers, size_t worker_index)
{
@@ -443,6 +488,11 @@ static const rtems_test_parallel_job test_jobs[] = {
.fini = test_enter_list_op_exit_preempt_fini,
.cascade = true
}, {
+ .init = test_list_init,
+ .body = test_enter_list_op_exit_drain_body,
+ .fini = test_enter_list_op_exit_drain_fini,
+ .cascade = true
+ }, {
.init = test_init,
.body = test_thread_local_mutex_body,
.fini = test_thread_local_mutex_fini,