Skip to content

Commit

Permalink
Name remux threads
Browse files Browse the repository at this point in the history
This gives the threads custom names to easily identify which thread is doing work in tools like htop.
  • Loading branch information
Eeems authored May 24, 2024
1 parent bf41113 commit ab88c7d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/remux/launcher.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ class App: public IApp:
_ := system("mkdir /run/ 2> /dev/null")
_ = system("/usr/bin/mkfifo /run/remux.api 2>/dev/null")
self.ipc_thread = new thread([=]() {
prctl(PR_SET_NAME, "fifo\0", 0, 0, 0)
fd := open("/run/remux.api", O_RDONLY)

string remainder = ""
Expand Down Expand Up @@ -491,6 +492,7 @@ class App: public IApp:
debug "STARTING SUSPEND THREAD"
version := util::get_remarkable_version()
self.idle_thread = new thread([=]() {
prctl(PR_SET_NAME, "suspend\0", 0, 0, 0)
last_wake := 0
while true:
now := time(NULL)
Expand Down

0 comments on commit ab88c7d

Please sign in to comment.