summaryrefslogtreecommitdiff
path: root/tests/lib/test_heavy_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/test_heavy_thread.c')
-rw-r--r--tests/lib/test_heavy_thread.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/lib/test_heavy_thread.c b/tests/lib/test_heavy_thread.c
index afbd205451..4fb9ebfa3a 100644
--- a/tests/lib/test_heavy_thread.c
+++ b/tests/lib/test_heavy_thread.c
@@ -14,7 +14,7 @@
#include <zebra.h>
#include <math.h>
-#include "thread.h"
+#include "frrevent.h"
#include "vty.h"
#include "command.h"
#include "memory.h"
@@ -22,7 +22,7 @@
#include "tests.h"
-extern struct thread_master *master;
+extern struct event_loop *master;
enum { ITERS_FIRST = 0,
ITERS_ERR = 100,
@@ -56,9 +56,9 @@ static void slow_func(struct vty *vty, const char *str, const int i)
printf("%s did %d, x = %g\n", str, i, x);
}
-static void clear_something(struct thread *thread)
+static void clear_something(struct event *thread)
{
- struct work_state *ws = THREAD_ARG(thread);
+ struct work_state *ws = EVENT_ARG(thread);
/* this could be like iterating through 150k of route_table
* or worse, iterating through a list of peers, to bgp_stop them with
@@ -67,9 +67,9 @@ static void clear_something(struct thread *thread)
while (ws->i < ITERS_MAX) {
slow_func(ws->vty, ws->str, ws->i);
ws->i++;
- if (thread_should_yield(thread)) {
- thread_add_timer_msec(master, clear_something, ws, 0,
- NULL);
+ if (event_should_yield(thread)) {
+ event_add_timer_msec(master, clear_something, ws, 0,
+ NULL);
return;
}
}
@@ -102,7 +102,7 @@ DEFUN (clear_foo,
ws->vty = vty;
ws->i = ITERS_FIRST;
- thread_add_timer_msec(master, clear_something, ws, 0, NULL);
+ event_add_timer_msec(master, clear_something, ws, 0, NULL);
return CMD_SUCCESS;
}