[*] Amend for UNIX Version 3

This commit is contained in:
Reece Wilson 2024-09-23 22:46:04 +01:00
parent 7046ccec11
commit 6f51e9261d
2 changed files with 18 additions and 1 deletions

View File

@ -611,7 +611,12 @@ namespace Aurora::Threading::Threads
#if defined(AURORA_IS_POSIX_DERIVED)
this->bLongJmpOnce = false;
#if defined(POSIX_USE_SIGJMP) && POSIX_USE_SIGJMP == 1
if (sigsetjmp(env, 1) != 0)
#else
if (setjmp(env) != 0)
#endif
{
Exit(true);
return;
@ -1514,7 +1519,12 @@ namespace Aurora::Threading::Threads
AuProcess::Exit(0);
return true;
}
#if defined(POSIX_USE_SIGJMP) && POSIX_USE_SIGJMP == 1
::siglongjmp(env, 1);
#else
::longjmp(env, 1);
#endif
}
::pthread_exit(nullptr);
#endif

View File

@ -9,6 +9,9 @@
#if defined(AURORA_IS_POSIX_DERIVED)
#include <setjmp.h>
#if !defined(POSIX_USE_SIGJMP)
#define POSIX_USE_SIGJMP 1
#endif
#endif
namespace Aurora::Threading::Threads
@ -85,7 +88,11 @@ namespace Aurora::Threading::Threads
private:
#if defined(AURORA_IS_POSIX_DERIVED)
jmp_buf env;
#if defined(POSIX_USE_SIGJMP) && POSIX_USE_SIGJMP == 1
sigjmp_buf env;
#else
jmp_buf env;
#endif
#endif
Primitives::Mutex tlsLock_;
AuUInt32 tls_ {};