summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audio_backend.h8
-rw-r--r--libs/ardour/ardour/audioengine.h3
-rw-r--r--libs/ardour/ardour/graph.h3
-rw-r--r--libs/ardour/ardour/types.h11
4 files changed, 22 insertions, 3 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h
index ab37bea526..6c4a54da3e 100644
--- a/libs/ardour/ardour/audio_backend.h
+++ b/libs/ardour/ardour/audio_backend.h
@@ -399,7 +399,13 @@ class AudioBackend {
* stacksize. The thread will begin executing @param func, and will exit
* when that function returns.
*/
- virtual int create_process_thread (boost::function<void()> func, pthread_t*, size_t stacksize) = 0;
+ virtual int create_process_thread (boost::function<void()> func, AudioBackendNativeThread*, size_t stacksize) = 0;
+
+ /** Wait for the thread specified by @param thread to exit.
+ *
+ * Return zero on success, non-zero on failure.
+ */
+ virtual int wait_for_process_thread_exit (AudioBackendNativeThread thread) = 0;
virtual void update_latencies () = 0;
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index cf4f91d4d0..21206da8fc 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -100,7 +100,8 @@ public:
pframes_t sample_time_at_cycle_start ();
pframes_t samples_since_cycle_start ();
bool get_sync_offset (pframes_t& offset) const;
- int create_process_thread (boost::function<void()> func, pthread_t*, size_t stacksize);
+ int create_process_thread (boost::function<void()> func, AudioBackendNativeThread*, size_t stacksize);
+ int wait_for_process_thread_exit (AudioBackendNativeThread);
bool is_realtime() const;
bool connected() const;
diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h
index cac09d34af..08af6fb721 100644
--- a/libs/ardour/ardour/graph.h
+++ b/libs/ardour/ardour/graph.h
@@ -36,6 +36,7 @@
#include "pbd/semutils.h"
#include "ardour/types.h"
+#include "ardour/audio_backend.h"
#include "ardour/session_handle.h"
namespace ARDOUR
@@ -92,7 +93,7 @@ protected:
virtual void session_going_away ();
private:
- std::list<pthread_t> _thread_list;
+ std::list<AudioBackendNativeThread> _thread_list;
volatile bool _quit_threads;
void reset_thread_list ();
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 17bffc20e4..f2319d7669 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -26,6 +26,7 @@
#include <boost/shared_ptr.hpp>
#include <sys/types.h>
#include <stdint.h>
+#include <pthread.h>
#include <inttypes.h>
@@ -609,6 +610,16 @@ namespace ARDOUR {
uint32_t max; //< samples
};
+/* PLATFORM SPECIFIC #ifdef's here */
+
+ /** Define the native thread type used on the platform */
+ typedef pthread_t AudioBackendNativeThread;
+ static inline bool self_thread_equal (AudioBackendNativeThread thr) {
+ return pthread_equal (thr, pthread_self());
+ }
+
+/* PLATFORM SPECIFIC #endif's here */
+
} // namespace ARDOUR