From 2b348f7c4158022d8747ba7fe22c93197d6a059b Mon Sep 17 00:00:00 2001 From: asvitkine <> Date: Sat, 21 Apr 2012 16:02:05 +0000 Subject: [PATCH] Don't start the Darwin media_thread if "nocdrom" pref is set. The media thread is currently only used to poll for CDROM devices and is not useful when "nocdrom" is set. This change also fixes the problem of the emulator preventing the CD to be ejected at the host level despite "nocdrom" being set in prefs. Thanks to Robert Munafo for investigating this problem! --- BasiliskII/src/MacOSX/sys_darwin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BasiliskII/src/MacOSX/sys_darwin.cpp b/BasiliskII/src/MacOSX/sys_darwin.cpp index dece5935..75fa2b52 100644 --- a/BasiliskII/src/MacOSX/sys_darwin.cpp +++ b/BasiliskII/src/MacOSX/sys_darwin.cpp @@ -66,8 +66,10 @@ extern void SysMediaRemoved(const char *path, int type); void DarwinSysInit(void) { - media_thread_active = (pthread_create(&media_thread, NULL, media_poll_func, NULL) == 0); - D(bug("Media poll thread installed (%ld)\n", media_thread)); + if (!PrefsFindBool("nocdrom")) { + media_thread_active = (pthread_create(&media_thread, NULL, media_poll_func, NULL) == 0); + D(bug("Media poll thread installed (%ld)\n", media_thread)); + } }