Expose pthread feature flag

The code was able to use pthread destructors rather than C++ thread
local destructors.  This removes the dependence on a C++ .so on linux.
However, this is not stable on other platforms such as Apple. Where the
C++ thread local state can be cleared before the pthread destructor
runs.
This commit is contained in:
Matthew Parkinson
2021-08-25 11:26:44 +01:00
committed by Matthew Parkinson
parent ea90f7b9c2
commit b52e2a6e27
4 changed files with 20 additions and 3 deletions

View File

@@ -19,6 +19,7 @@
# if defined(SNMALLOC_THREAD_TEARDOWN_DEFINED)
# error At most one out of method of thread teardown can be specified.
# else
# include <pthread.h>
# define SNMALLOC_THREAD_TEARDOWN_DEFINED
# endif
#endif
@@ -95,7 +96,7 @@ namespace snmalloc
}
};
# ifdef SNMALLOC_USE_PTHREAD_DESTRUCTOR
# ifdef SNMALLOC_USE_PTHREAD_DESTRUCTORS
/**
* Used to give correct signature to teardown required by pthread_key.
*/