mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-24 11:01:00 +01:00
BUILD: threads: fix -Wundef for _POSIX_PRIORITY_SCHEDULING on libmusl
Building with an old musl-based toolchain reported this warning:
include/haproxy/thread.h: In function 'ha_thread_relax':
include/haproxy/thread.h:256:5: warning: "_POSIX_PRIORITY_SCHEDULING" is not defined [-Wundef]
#if _POSIX_PRIORITY_SCHEDULING
^
There were indeed two "#if" insteadd of #ifdef" for this macro, let's
fix them.
This commit is contained in:
parent
80d3daad50
commit
8ab9419394
@ -103,7 +103,7 @@ static inline unsigned long long ha_get_pthread_id(unsigned int thr)
|
||||
|
||||
static inline void ha_thread_relax(void)
|
||||
{
|
||||
#if _POSIX_PRIORITY_SCHEDULING
|
||||
#ifdef _POSIX_PRIORITY_SCHEDULING
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
@ -253,7 +253,7 @@ static inline unsigned long long ha_get_pthread_id(unsigned int thr)
|
||||
|
||||
static inline void ha_thread_relax(void)
|
||||
{
|
||||
#if _POSIX_PRIORITY_SCHEDULING
|
||||
#ifdef _POSIX_PRIORITY_SCHEDULING
|
||||
sched_yield();
|
||||
#else
|
||||
pl_cpu_relax();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user