summaryrefslogtreecommitdiff
path: root/mpd/stacksize.patch
blob: 291a2f22d735a9eec26389a553d67090ce056202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- ./src/thread/Thread.cxx.orig
+++ ./src/thread/Thread.cxx
@@ -35,8 +35,12 @@
 	if (handle == nullptr)
 		throw MakeLastError("Failed to create thread");
 #else
-	int e = pthread_create(&handle, nullptr, ThreadProc, this);
-
+	pthread_attr_t attr, *attrptr = nullptr;
+	if ((pthread_attr_init(&attr) == 0)
+		&& (pthread_attr_setstacksize(&attr, 1024*1024) == 0)) {
+		attrptr = &attr;
+	}
+	int e = pthread_create(&handle, attrptr, ThreadProc, this);
 	if (e != 0)
 		throw MakeErrno(e, "Failed to create thread");
 #endif