Browse Source

MT#56374 move pthread helper functions to auxlib

The poller (also in lib) depends on this.

Change-Id: Iabf7c2ddef129401c19ae6a1f4f391ab9eaa4367
pull/1694/head
Richard Fuchs 2 years ago
parent
commit
16c08efe62
2 changed files with 13 additions and 11 deletions
  1. +0
    -11
      include/helpers.h
  2. +13
    -0
      lib/auxlib.h

+ 0
- 11
include/helpers.h View File

@ -304,17 +304,6 @@ INLINE void thread_create_detach(void (*f)(void *), void *a, const char *name) {
thread_create_detach_prio(f, a, NULL, 0, name); thread_create_detach_prio(f, a, NULL, 0, name);
} }
#ifndef ASAN_BUILD
#define thread_cancel_enable() pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL)
#define thread_cancel_disable() pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL)
#define thread_sleep_time 10000 /* ms */
#else
#define thread_cancel_enable() ((void)0)
#define thread_cancel_disable() ((void)0)
#define thread_sleep_time 100 /* ms */
#endif
/*** ATOMIC BITFIELD OPERATIONS ***/ /*** ATOMIC BITFIELD OPERATIONS ***/


+ 13
- 0
lib/auxlib.h View File

@ -124,6 +124,19 @@ INLINE int __cond_timedwait_tv(cond_t *c, mutex_t *m, const struct timeval *tv)
return pthread_cond_timedwait(c, m, &ts); return pthread_cond_timedwait(c, m, &ts);
} }
#ifndef ASAN_BUILD
#define thread_cancel_enable() pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL)
#define thread_cancel_disable() pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL)
#define thread_sleep_time 10000 /* ms */
#else
#define thread_cancel_enable() ((void)0)
#define thread_cancel_disable() ((void)0)
#define thread_sleep_time 100 /* ms */
#endif
#ifndef __THREAD_DEBUG #ifndef __THREAD_DEBUG
#define __debug_mutex_init(m, F, L) pthread_mutex_init(m, NULL) #define __debug_mutex_init(m, F, L) pthread_mutex_init(m, NULL)


Loading…
Cancel
Save