Update to use new this_thread::Poll().

This commit is contained in:
Jari Sundell
2025-05-31 15:22:31 +02:00
committed by GitHub
parent 3618b9dc4f
commit e8c1f3ed2c
6 changed files with 36 additions and 72 deletions
+10 -6
View File
@@ -1,5 +1,6 @@
#include "config.h"
#include <cassert>
#include <rak/error_number.h>
#include <rak/socket_address.h>
#include <sys/un.h>
@@ -13,6 +14,7 @@
#include "rpc/scgi_task.h"
#include "utils/socket_fd.h"
// TODO: Figure out why moving this to the top causes a build error.
#include "rpc/scgi.h"
namespace rpc {
@@ -90,16 +92,18 @@ SCgi::open(void* sa, unsigned int length) {
void
SCgi::activate() {
worker_thread->poll()->open(this);
worker_thread->poll()->insert_read(this);
worker_thread->poll()->insert_error(this);
assert(std::this_thread::get_id() == worker_thread->thread_id() && "SCgi::activate() must be called from the worker thread.");
torrent::this_thread::poll()->open(this);
torrent::this_thread::poll()->insert_read(this);
torrent::this_thread::poll()->insert_error(this);
}
void
SCgi::deactivate() {
worker_thread->poll()->remove_read(this);
worker_thread->poll()->remove_error(this);
worker_thread->poll()->close(this);
assert(std::this_thread::get_id() == worker_thread->thread_id() && "SCgi::deactivate() must be called from the worker thread.");
torrent::this_thread::poll()->remove_and_close(this);
}
void