diff options
author | Robin Gareus <robin@gareus.org> | 2012-08-28 15:42:35 +0000 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2012-08-28 15:42:35 +0000 |
commit | 9ab45f37c6fa866762fae8bb01f72eacdc75abd3 (patch) | |
tree | aabb484cbad0015c4024e0a794ffb26865f58351 /libs/ardour/ardour/worker.h | |
parent | a8f0c3255f6f645913f57748d34db640bc7adcc2 (diff) |
LV2 worker: prevent corruption of ringbuffer
git-svn-id: svn://localhost/ardour2/branches/3.0@13146 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/worker.h')
-rw-r--r-- | libs/ardour/ardour/worker.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/ardour/ardour/worker.h b/libs/ardour/ardour/worker.h index cdc3d1d06d..4f3ff54bc1 100644 --- a/libs/ardour/ardour/worker.h +++ b/libs/ardour/ardour/worker.h @@ -75,6 +75,16 @@ public: private: void run(); + /** + Peek in RB, get size and check if a block of 'size' is available. + + Handle the unlikley edge-case, if we're called in between the + responder writing 'size' and 'data'. + + @param rb the ringbuffer to check + @return true if the message is complete, false otherwise + */ + bool verify_message_completeness(RingBuffer<uint8_t>* rb); Workee* _workee; RingBuffer<uint8_t>* _requests; @@ -82,7 +92,8 @@ private: uint8_t* _response; PBD::Semaphore _sem; bool _exit; - Glib::Threads::Thread* _thread; + Glib::Threads::Thread* _thread; + }; } // namespace ARDOUR |