lfields移除trigger

Signed-off-by: liaoxingxing <liaoxingbin@h-partners.com>
This commit is contained in:
liaoxingxing 2024-12-23 21:47:35 +08:00
parent db8ae3084e
commit e09658c7bc
2 changed files with 5 additions and 7 deletions

View File

@ -470,9 +470,9 @@ static void uv__get_process_name(char* processName, int bufferLength) {
}
}
static void uv__set_signal_flag(uv__loop_internal_fields_t* lfields) {
static int uv__set_signal_flag() {
static int trigger = -1;
if (trigger == -1) {
char processName[1024] = {0};
uv__get_process_name(processName, sizeof(processName));
@ -483,7 +483,7 @@ static void uv__set_signal_flag(uv__loop_internal_fields_t* lfields) {
trigger = 1;
}
}
lfields->trigger = (unsigned int)trigger;
return trigger;
}
#endif
@ -500,7 +500,7 @@ static void uv__signal_event(uv_loop_t* loop,
bytes = 0;
end = 0;
#ifdef USE_FFRT
uv__set_signal_flag(loop->internal_fields);
unsigned int trigger = uv__set_signal_flag();
#endif
do {
r = read(loop->signal_pipefd[0], buf + bytes, sizeof(buf) - bytes);
@ -542,8 +542,7 @@ static void uv__signal_event(uv_loop_t* loop,
if (msg->signum == handle->signum) {
assert(!(handle->flags & UV_HANDLE_CLOSING));
#ifdef USE_FFRT
uv__loop_internal_fields_t* lfields = uv__get_internal_fields(handle->loop);
if (lfields->trigger != 1) {
if (trigger != 1) {
handle->signal_cb(handle, handle->signum);
}
#else

View File

@ -449,7 +449,6 @@ struct uv__loop_internal_fields_s {
#endif /* __linux__ */
#ifdef USE_FFRT
struct uv__queue wq_sub[5];
unsigned int trigger;
#endif
};