Skip to content

ipc: Improve teardown process - #5266

Merged
Alexays merged 1 commit into
Alexays:masterfrom
aokblast:ipc/fix_close_down
Aug 27, 2026
Merged

ipc: Improve teardown process#5266
Alexays merged 1 commit into
Alexays:masterfrom
aokblast:ipc/fix_close_down

Conversation

@aokblast

Copy link
Copy Markdown
Contributor
  1. Use shutdown before stop the thread: shutdown(2) rejects all following tx and rx but keep the fd opened. It is better than writing garbage value to the ipc server.
  2. Use SleeperThread::sleep_for to prevent 2 second wait: stop() sets running status and notify the SleeperThread. As a result, we can use SleeperThread::sleep_for instead of std::thread::sleep_for to prevent wait for 2 seconds then stop

1. Use shutdown before stop the thread:
shutdown(2) rejects all following tx and rx but keep the fd opened. It
is better than writing garbage value to the ipc server.
2. Use SleeperThread::sleep_for to prevent 2 second wait:
stop() sets running status and notify the SleeperThread. As a result, we
can use SleeperThread::sleep_for instead of std::thread::sleep_for to
prevent wait for 2 seconds then stop
@Alexays
Alexays merged commit d742d47 into Alexays:master Aug 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants