Skip to content

Commit 21d6253

Browse files
committed
optimize code
1 parent d92d4a5 commit 21d6253

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

include/swoole_win32.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,8 @@ typedef void *pthread_t;
973973
#define swoole_jump_fcontext jump_fcontext
974974
#define swoole_make_fcontext make_fcontext
975975

976-
void swoole_signal_block_all();
976+
#define swoole_signal_block_all()
977+
#define swoole_signal_clear()
978+
#define swoole_signal_dispatch()
977979

978980
#endif // _WIN32

src/core/base.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ void swoole_clean() {
211211
}
212212
}
213213

214-
#ifndef _WIN32
215214
swoole_signal_clear();
216-
#endif
217215
swoole_thread_clean(true);
218216

219217
if (SwooleG.logger) {
@@ -377,9 +375,7 @@ pid_t swoole_fork(int flags) {
377375
} else {
378376
sw_logger()->close();
379377
}
380-
#ifndef _WIN32
381378
swoole_signal_clear();
382-
#endif
383379
if (swoole_isset_hook(SW_GLOBAL_HOOK_AFTER_FORK)) {
384380
swoole_call_hook(SW_GLOBAL_HOOK_AFTER_FORK, nullptr);
385381
}
@@ -397,11 +393,9 @@ void swoole_thread_init(bool main_thread) {
397393
if (!SwooleTG.buffer_stack) {
398394
SwooleTG.buffer_stack = new String(SW_STACK_BUFFER_SIZE);
399395
}
400-
#ifndef _WIN32
401396
if (!main_thread) {
402397
swoole_signal_block_all();
403398
}
404-
#endif
405399
SwooleTG.main_thread = main_thread;
406400
}
407401

src/network/socket.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,7 @@ int Socket::wait_event(int timeout_ms, int _events) const {
322322
swoole_set_last_error(SW_SOCKET_ERRNO);
323323
return SW_ERR;
324324
}
325-
#ifndef _WIN32
326325
swoole_signal_dispatch();
327-
#endif
328326
continue;
329327
}
330328
return SW_OK;

0 commit comments

Comments
 (0)