summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-28 19:49:03 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-28 19:49:03 +0200
commite858dce757f8766a29f2151ec3ffef3df85af66b (patch)
tree3d60cd0d5da345aac0c852b166eb04bec91f3632 /lib
parent00f6b162c9c357bddf48d52d08b6abb6010004b6 (diff)
Moved the thread starting code to IO loop code
Diffstat (limited to 'lib')
-rw-r--r--lib/coro.h29
-rw-r--r--lib/timer.c3
-rw-r--r--lib/timer.h1
3 files changed, 1 insertions, 32 deletions
diff --git a/lib/coro.h b/lib/coro.h
deleted file mode 100644
index 17ccff89..00000000
--- a/lib/coro.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * BIRD Coroutines
- *
- * (c) 2017 Martin Mares <mj@ucw.cz>
- * (c) 2020-2021 Maria Matejka <mq@jmq.cz>
- *
- * Can be freely distributed and used under the terms of the GNU GPL.
- */
-
-#ifndef _BIRD_CORO_H_
-#define _BIRD_CORO_H_
-
-#include "lib/resource.h"
-
-/* A completely opaque coroutine handle. */
-struct coroutine;
-
-/* Coroutines are independent threads bound to pools.
- * You request a coroutine by calling coro_run().
- * It is forbidden to free a running coroutine from outside.
- * The running coroutine must free itself by rfree() before returning.
- */
-struct coroutine *coro_run(pool *, void (*entry)(void *), void *data);
-
-/* Get self. */
-extern _Thread_local struct coroutine *this_coro;
-
-
-#endif
diff --git a/lib/timer.c b/lib/timer.c
index c1241ba7..ff6975a4 100644
--- a/lib/timer.c
+++ b/lib/timer.c
@@ -32,7 +32,6 @@
#include "nest/bird.h"
-#include "lib/coro.h"
#include "lib/heap.h"
#include "lib/resource.h"
#include "lib/timer.h"
@@ -117,7 +116,7 @@ tm_set_in_tl(timer *t, btime when, struct timeloop *local_timeloop)
t->loop = local_timeloop;
- if ((t->index == 1) && (local_timeloop->coro != this_coro))
+ if (t->index == 1)
birdloop_ping(local_timeloop->loop);
}
diff --git a/lib/timer.h b/lib/timer.h
index 04544ace..555fc96f 100644
--- a/lib/timer.h
+++ b/lib/timer.h
@@ -41,7 +41,6 @@ struct timeloop
BUFFER_(timer *) timers;
struct domain_generic *domain;
struct birdloop *loop;
- struct coroutine *coro;
};
#define TLOCK_TIMER_ASSERT(loop) ASSERT_DIE((loop)->domain && DG_IS_LOCKED((loop)->domain))