Skip to content

Commit acba1d2

Browse files
Enable multithreading on macos
1 parent dd0f635 commit acba1d2

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/common/init.c

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,33 @@ static inline void* startThreadsThreadMain(void* instance)
293293
return NULL;
294294
}
295295

296+
#if !defined(__ANDROID__) && !defined(__APPLE__)
297+
296298
void startDetectionThreads(FFinstance* instance)
297299
{
298-
//Android needs none of the things that are detected here
299-
//And using gsettings sometimes hangs the program in android for some unknown reason,
300-
//and since we don't need it we just never call it.
301-
#if defined(__ANDROID__) || defined(__APPLE__)
302-
return;
303-
#endif
304-
305300
pthread_t startThreadsThread;
306301
pthread_create(&startThreadsThread, NULL, startThreadsThreadMain, instance);
307302
pthread_detach(startThreadsThread);
308303
}
309304

305+
#elif __APPLE__
306+
307+
void startDetectionThreads(FFinstance* instance)
308+
{
309+
pthread_t startThreadsThread;
310+
pthread_create(&startThreadsThread, NULL, connectDisplayServerThreadMain, instance);
311+
pthread_detach(startThreadsThread);
312+
}
313+
314+
#else // !__APPLE__
315+
316+
void startDetectionThreads(FFinstance* instance)
317+
{
318+
FF_UNUSED(instance);
319+
}
320+
321+
#endif // __ANDROID__
322+
310323
static volatile bool ffDisableLinewrap = true;
311324
static volatile bool ffHideCursor = true;
312325

0 commit comments

Comments
 (0)