Skip to content

Commit cff66e6

Browse files
committed
util: Pass pthread_self() to pthread_setschedparam instead of 0
Nowhere in the man page of `pthread_setschedparam` it is mentioned that `0` is a valid value. The example uses `pthread_self()`, so should we. (noticed by Anthony Towns)
1 parent 603975b commit cff66e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ int ScheduleBatchPriority(void)
10651065
{
10661066
#ifdef SCHED_BATCH
10671067
const static sched_param param{.sched_priority = 0};
1068-
if (int ret = pthread_setschedparam(0, SCHED_BATCH, &param)) {
1068+
if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
10691069
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
10701070
return ret;
10711071
}

0 commit comments

Comments
 (0)