#include "pbd/unknown_type.h"
#include "pbd/epa.h"
-#include <jack/weakjack.h>
-
#include "midi++/port.h"
#include "midi++/jack_midi_port.h"
#include "midi++/mmc.h"
AudioEngine::meter_thread ()
{
pthread_set_name (X_("meter"));
-
while (true) {
- Glib::usleep (10000); /* 1/100th sec interval */
+ Glib::usleep (10000);
if (g_atomic_int_get(&m_meter_exit)) {
break;
}
}
int
-AudioEngine::create_process_thread (boost::function<void()> f, pthread_t* thread, size_t stacksize)
+AudioEngine::create_process_thread (boost::function<void()> f, jack_native_thread_t* thread, size_t stacksize)
{
GET_PRIVATE_JACK_POINTER_RET (_jack, 0);
ThreadData* td = new ThreadData (this, f, stacksize);
return 0;
}
+bool
+AudioEngine::stop_process_thread (jack_native_thread_t thread)
+{
+ /**
+ * can't use GET_PRIVATE_JACK_POINTER_RET (_jack, 0) here
+ * because _jack is 0 when this is called. At least for
+ * Jack 2 _jack arg is not used so it should be OK
+ */
+
+#if defined(USING_JACK2_EXPANSION_OF_JACK_API) || defined(WIN32)
+ if (jack_client_stop_thread (_jack, thread) != 0) {
+ error << "AudioEngine: cannot stop process thread" << endmsg;
+ return false;
+ }
+#else
+ void* status;
+ pthread_join (thread, &status);
+#endif
+
+ return true;
+}
+
void*
AudioEngine::_start_process_thread (void* arg)
{