Commit ba8b0738 authored by Sergey Lyubka's avatar Sergey Lyubka

Issue 317: increase priority of the master thread

parent 498f3715
......@@ -4029,6 +4029,15 @@ static void master_thread(struct mg_context *ctx) {
struct socket *sp;
int max_fd;
#if defined(ISSUE_317)
// Increase priority of the master thread
struct sched_param sched_param;
int policy;
pthread_getschedparam(pthread_self(), &policy, &sched_param);
sched_param.sched_priority = sched_get_priority_max(policy);
pthread_setschedparam(pthread_self(), policy, &sched_param);
#endif
while (ctx->stop_flag == 0) {
FD_ZERO(&read_set);
max_fd = -1;
......
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