aboutsummaryrefslogtreecommitdiffstats
path: root/main/guile/stacksize.patch
blob: a6a58d385c821cf78fe47dd3604bc210a3319e46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/libguile/finalizers.c b/libguile/finalizers.c
index c5d69e8..f8d78d8 100644
--- a/libguile/finalizers.c
+++ b/libguile/finalizers.c
@@ -246,11 +246,19 @@ start_finalization_thread (void)
 	 to block on any lock that scm_spawn_thread might want to take,
 	 and we don't want to inherit the dynamic state (fluids) of the
 	 caller.  */
-      if (pthread_create (&finalization_thread, NULL,
-			  run_finalization_thread, NULL))
-	perror ("error creating finalization thread");
+      pthread_attr_t attr;
+      if (pthread_attr_init(&attr))
+        perror ("pthread_attr_init");
       else
-	finalization_thread_is_running = 1;
+        {
+          if (pthread_attr_setstacksize(&attr, 512 * 1024) == 0 &&
+              pthread_create (&finalization_thread, &attr,
+			      run_finalization_thread, NULL) == 0)
+	    finalization_thread_is_running = 1;
+          else
+	    perror ("error creating finalization thread");
+          pthread_attr_destroy(&attr);
+	}
     }
   scm_i_pthread_mutex_unlock (&finalization_thread_lock);
 }