no longer need glibc pthread_atfork workaround
parent
3af44d2e6a
commit
0436227092
|
@ -1156,7 +1156,7 @@ COLD static void init_slow_path(void) {
|
|||
mutex_unlock(&lock);
|
||||
|
||||
// may allocate, so wait until the allocator is initialized to avoid deadlocking
|
||||
if (atfork(full_lock, full_unlock, post_fork_child)) {
|
||||
if (pthread_atfork(full_lock, full_unlock, post_fork_child)) {
|
||||
fatal_error("pthread_atfork failed");
|
||||
}
|
||||
}
|
||||
|
|
13
util.h
13
util.h
|
@ -38,19 +38,6 @@ typedef uint32_t u32;
|
|||
typedef uint64_t u64;
|
||||
typedef unsigned __int128 u128;
|
||||
|
||||
// use __register_atfork directly to avoid linking with libpthread for glibc < 2.28
|
||||
#ifdef __GLIBC__
|
||||
#if !__GLIBC_PREREQ(2, 28)
|
||||
extern void *__dso_handle;
|
||||
extern int __register_atfork(void (*)(void), void (*)(void), void (*)(void), void *);
|
||||
#define atfork(prepare, parent, child) __register_atfork(prepare, parent, child, __dso_handle)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef atfork
|
||||
#define atfork pthread_atfork
|
||||
#endif
|
||||
|
||||
#if CONFIG_SEAL_METADATA
|
||||
|
||||
#ifdef __GLIBC__
|
||||
|
|
Loading…
Reference in New Issue