aboutsummaryrefslogtreecommitdiff
path: root/boehmgc-coroutine-sp-fallback.diff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-09-25 13:46:55 -0400
committereldritch horrors <pennae@lix.systems>2024-03-04 04:36:04 +0100
commitbc4aa3d5dbb2f4d92a0c7296a3349ba38cae8540 (patch)
tree1e10cb1b5865210b1bfedf3bcb5c4c4f8f29478e /boehmgc-coroutine-sp-fallback.diff
parent2442a40393f64d9db75b928f4549ebc96b4569a9 (diff)
Merge pull request #8887 from obsidiansystems/bsd-cross-ci
Support cross compiling to BSD and CI it (cherry picked from commit 1f3fc08c5994ca69c84c9e745d59ec2bb2fd820a) Change-Id: I415e92952afc661cfb5ef91a76c0637678a04a19
Diffstat (limited to 'boehmgc-coroutine-sp-fallback.diff')
-rw-r--r--boehmgc-coroutine-sp-fallback.diff10
1 files changed, 8 insertions, 2 deletions
diff --git a/boehmgc-coroutine-sp-fallback.diff b/boehmgc-coroutine-sp-fallback.diff
index 5066d8278..2afbe9671 100644
--- a/boehmgc-coroutine-sp-fallback.diff
+++ b/boehmgc-coroutine-sp-fallback.diff
@@ -59,12 +59,18 @@ index b5d71e62..aed7b0bf 100644
GC_bool found_me = FALSE;
size_t nthreads = 0;
int i;
-@@ -851,6 +853,31 @@ GC_INNER void GC_push_all_stacks(void)
+@@ -851,6 +853,37 @@ GC_INNER void GC_push_all_stacks(void)
hi = p->altstack + p->altstack_size;
/* FIXME: Need to scan the normal stack too, but how ? */
/* FIXME: Assume stack grows down */
+ } else {
-+ if (pthread_getattr_np(p->id, &pattr)) {
++#ifdef HAVE_PTHREAD_ATTR_GET_NP
++ if (!pthread_attr_init(&pattr)
++ || !pthread_attr_get_np(p->id, &pattr))
++#else /* HAVE_PTHREAD_GETATTR_NP */
++ if (pthread_getattr_np(p->id, &pattr))
++#endif
++ {
+ ABORT("GC_push_all_stacks: pthread_getattr_np failed!");
+ }
+ if (pthread_attr_getstacksize(&pattr, &stack_limit)) {