mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-24 05:41:14 -03:00
Use PTHREAD_THREADS_MAX if available
Stops us deadlocking on OpenBSD if we need more than 4 threads. Fixes #6503
This commit is contained in:
@@ -21,11 +21,17 @@
|
||||
#include "global_safety.h"
|
||||
#include "wutil.h"
|
||||
|
||||
#ifdef PTHREAD_THREADS_MAX
|
||||
#if PTHREAD_THREADS_MAX < 64
|
||||
#define IO_MAX_THREADS PTHREAD_THREADS_MAX
|
||||
#endif
|
||||
#else
|
||||
#ifdef _POSIX_THREAD_THREADS_MAX
|
||||
#if _POSIX_THREAD_THREADS_MAX < 64
|
||||
#define IO_MAX_THREADS _POSIX_THREAD_THREADS_MAX
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef IO_MAX_THREADS
|
||||
#define IO_MAX_THREADS 64
|
||||
|
||||
Reference in New Issue
Block a user