Skip to content

Commit

Permalink
try fix pthread compile crash
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed Jun 24, 2024
1 parent faa4a21 commit 206a30b
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/c11/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(_WIN32) && !defined(HAVE_PTHREAD)
# include <io.h> /* close */
# include <process.h> /* _exit */
#elif defined(HAVE_PTHREAD)
#elif defined(HAVE_PTHREAD) && !defined(__ANDROID__)
# include <pthread.h>
# include <unistd.h> /* close, _exit */
#else
Expand Down Expand Up @@ -113,7 +113,7 @@ typedef struct
} once_flag;
# define ONCE_FLAG_INIT {0}
# define TSS_DTOR_ITERATIONS 1
#elif defined(HAVE_PTHREAD)
#elif defined(HAVE_PTHREAD) && !defined(__ANDROID__)
typedef pthread_cond_t cnd_t;
typedef pthread_t thrd_t;
typedef pthread_key_t tss_t;
Expand Down
2 changes: 1 addition & 1 deletion src/gallium/frontends/nine/nine_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ _nine_debug_printf( unsigned long flag,
dbg_flags |= debug_get_flags_option("NINE_DEBUG", nine_debug_flags, 0);
}

#if defined(HAVE_PTHREAD)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__)
if (dbg_flags & DBG_TID)
tid = (unsigned long)pthread_self();
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/util/rwlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef RWLOCK_H
#define RWLOCK_H

#if defined(HAVE_PTHREAD)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__)
#include <pthread.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/util/u_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* IN THE SOFTWARE.
*/

#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD)
#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD) && !defined(__ANDROID__)

#include <stdint.h>
#include <pthread.h>
Expand Down
6 changes: 3 additions & 3 deletions src/util/u_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int u_thread_create(thrd_t *thrd, int (*routine)(void *), void *param)

void u_thread_setname( const char *name )
{
#if defined(HAVE_PTHREAD)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__)
#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || defined(__GLIBC__) || DETECT_OS_MANAGARM
int ret = pthread_setname_np(pthread_self(), name);
if (ret == ERANGE) {
Expand Down Expand Up @@ -154,7 +154,7 @@ util_set_thread_affinity(thrd_t thread,
int64_t
util_thread_get_time_nano(thrd_t thread)
{
#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__managarm__)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__) && !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__managarm__)
struct timespec ts;
clockid_t cid;

Expand All @@ -174,7 +174,7 @@ util_thread_get_time_nano(thrd_t thread)
#endif
}

#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__) && !defined(__APPLE__) && !defined(__HAIKU__)

void util_barrier_init(util_barrier *barrier, unsigned count)
{
Expand Down
2 changes: 1 addition & 1 deletion src/util/u_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static inline bool u_thread_is_self(thrd_t thread)
* util_barrier
*/

#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__) && !defined(__APPLE__) && !defined(__HAIKU__)

typedef pthread_barrier_t util_barrier;

Expand Down
2 changes: 1 addition & 1 deletion src/vulkan/wsi/wsi_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ configure_image(const struct wsi_swapchain *chain,
}
}

#if defined(HAVE_PTHREAD) && !defined(_WIN32)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__) && !defined(_WIN32)
bool
wsi_init_pthread_cond_monotonic(pthread_cond_t *cond)
{
Expand Down
2 changes: 1 addition & 1 deletion src/vulkan/wsi/wsi_common_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void wsi_headless_finish_wsi(struct wsi_device *wsi_device,
VK_DEFINE_NONDISP_HANDLE_CASTS(wsi_swapchain, base, VkSwapchainKHR,
VK_OBJECT_TYPE_SWAPCHAIN_KHR)

#if defined(HAVE_PTHREAD) && !defined(_WIN32)
#if defined(HAVE_PTHREAD) && !defined(__ANDROID__) && !defined(_WIN32)
bool
wsi_init_pthread_cond_monotonic(pthread_cond_t *cond);
#endif
Expand Down

0 comments on commit 206a30b

Please sign in to comment.