Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 246d53c

Browse files
authored
Merge pull request #2007 from yshui/musl_libc_src_core_thread
Add musl libc definitions to: src_core_thread merged-on-behalf-of: Iain Buclaw <ibuclaw@gdcproject.org>
2 parents 9e5dd2d + d355984 commit 246d53c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/core/thread.d

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,6 +3199,7 @@ extern (C) @nogc nothrow
31993199
version (NetBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr);
32003200
version (Solaris) int thr_stksegment(stack_t* stk);
32013201
version (CRuntime_Bionic) int pthread_getattr_np(pthread_t thid, pthread_attr_t* attr);
3202+
version (CRuntime_Musl) int pthread_getattr_np(pthread_t, pthread_attr_t*);
32023203
}
32033204

32043205

@@ -3285,6 +3286,16 @@ private void* getStackBottom() nothrow @nogc
32853286
pthread_attr_destroy(&attr);
32863287
return addr + size;
32873288
}
3289+
else version (CRuntime_Musl)
3290+
{
3291+
pthread_attr_t attr;
3292+
void* addr; size_t size;
3293+
3294+
pthread_getattr_np(pthread_self(), &attr);
3295+
pthread_attr_getstack(&attr, &addr, &size);
3296+
pthread_attr_destroy(&attr);
3297+
return addr + size;
3298+
}
32883299
else
32893300
static assert(false, "Platform not supported.");
32903301
}

0 commit comments

Comments
 (0)