Commit 5eb468bc authored by Max Kellermann's avatar Max Kellermann

Thread/Util: make SCHED_RESET_ON_FORK optional

Use it if it exists, but don't insist if the C library is poor (e.g. Bionic/Android).
parent 7f8dd0e9
......@@ -78,7 +78,13 @@ SetThreadRealtime()
#ifdef __linux__
struct sched_param sched_param;
sched_param.sched_priority = 50;
sched_setscheduler(0, SCHED_FIFO|SCHED_RESET_ON_FORK, &sched_param);
int policy = SCHED_FIFO;
#ifdef SCHED_RESET_ON_FORK
policy |= SCHED_RESET_ON_FORK;
#endif
sched_setscheduler(0, policy, &sched_param);
#endif
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment