@@ -159,6 +159,7 @@ struct ReactorThread {
159
159
MessageBus message_bus;
160
160
161
161
int init (Server *serv, Reactor *reactor, uint16_t reactor_id);
162
+ void shutdown (Reactor *reactor);
162
163
};
163
164
164
165
struct ServerPortGS {
@@ -1125,6 +1126,7 @@ class Server {
1125
1126
}
1126
1127
1127
1128
void stop_async_worker (Worker *worker);
1129
+ void stop_master_thread ();
1128
1130
1129
1131
Pipe *get_pipe_object (int pipe_fd) {
1130
1132
return (Pipe *) connection_list[pipe_fd].object ;
@@ -1150,6 +1152,10 @@ class Server {
1150
1152
return factory != nullptr ;
1151
1153
}
1152
1154
1155
+ bool is_running () {
1156
+ return running;
1157
+ }
1158
+
1153
1159
bool is_master () {
1154
1160
return swoole_get_process_type () == SW_PROCESS_MASTER;
1155
1161
}
@@ -1174,6 +1180,10 @@ class Server {
1174
1180
return is_thread_mode () && swoole_get_thread_type () == Server::THREAD_WORKER;
1175
1181
}
1176
1182
1183
+ bool is_worker_process () {
1184
+ return !is_thread_mode () && (is_worker () || is_task_worker ());
1185
+ }
1186
+
1177
1187
bool is_reactor_thread () {
1178
1188
return swoole_get_thread_type () == Server::THREAD_REACTOR;
1179
1189
}
@@ -1421,6 +1431,15 @@ class Server {
1421
1431
void worker_signal_init (void );
1422
1432
std::function<void (const WorkerFn &fn)> worker_thread_start;
1423
1433
1434
+ /* *
1435
+ * [Master]
1436
+ */
1437
+ bool signal_handler_shutdown ();
1438
+ bool signal_handler_child_exit ();
1439
+ bool signal_handler_reload (bool reload_all_workers);
1440
+ bool signal_handler_read_message ();
1441
+ bool signal_handler_reopen_logger ();
1442
+
1424
1443
static int worker_main_loop (ProcessPool *pool, Worker *worker);
1425
1444
static void worker_signal_handler (int signo);
1426
1445
static void reactor_thread_main_loop (Server *serv, int reactor_id);
0 commit comments