Emit Signal when MCSS Threads are exhausted
By default Windows has limit of 32 MMCSS threads. Ardour uses MMCSS scheduling for for hardware I/O (audio and MIDI) as well as for realtime process threads, and a user on a recent machine may run into this limit.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "pbd/signals.h"
|
||||
#include "pbd/libpbd_visibility.h"
|
||||
|
||||
namespace PBD {
|
||||
@@ -55,6 +56,8 @@ bool LIBPBD_API revert_thread_characteristics (HANDLE task_handle);
|
||||
|
||||
bool LIBPBD_API set_thread_priority (HANDLE, AVRT_PRIORITY);
|
||||
|
||||
extern Signal<void()> MMCSSError;
|
||||
|
||||
} // namespace MMCSS
|
||||
|
||||
} // namespace PBD
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace PBD {
|
||||
|
||||
namespace MMCSS {
|
||||
|
||||
Signal<void()> MMCSSError;
|
||||
|
||||
bool
|
||||
initialize ()
|
||||
{
|
||||
@@ -133,6 +135,8 @@ set_thread_characteristics (const std::string& task_name, HANDLE* task_handle)
|
||||
DEBUG_THREADS("MMCSS: Privilege not held\n");
|
||||
break;
|
||||
default:
|
||||
/* this is likely because the maximum number of MMCSS threads has been reached */
|
||||
MMCSSError (); /* EMIT SIGNAL */
|
||||
DEBUG_THREADS("MMCSS: Unknown error setting thread characteristics\n");
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user