mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-22 06:36:29 +01:00
redesign cross-thread registration/signalling system
This new design will work even when threads that need to receive messages from RT threads are created *after* the RT threads. The existing design would fail because the RT thread(s) would never be known the later created threads, and so signals emitted by the RT thread and causing call_slot() in the receiver would end up being enqueued using a lock-protected list. The new design ensures that communication always uses a lock-free FIFO instead
This commit is contained in:
parent
db48340278
commit
0d9efc1148
25 changed files with 348 additions and 81 deletions
|
|
@ -154,16 +154,24 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope
|
|||
extern "C" {
|
||||
class ControlProtocolDescriptor {
|
||||
public:
|
||||
const char* name; /* descriptive */
|
||||
const char* id; /* unique and version-specific */
|
||||
void* ptr; /* protocol can store a value here */
|
||||
void* module; /* not for public access */
|
||||
int mandatory; /* if non-zero, always load and do not make optional */
|
||||
bool supports_feedback; /* if true, protocol has toggleable feedback mechanism */
|
||||
bool (*probe)(ControlProtocolDescriptor*);
|
||||
ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
|
||||
void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);
|
||||
|
||||
const char* name; /* descriptive */
|
||||
const char* id; /* unique and version-specific */
|
||||
void* ptr; /* protocol can store a value here */
|
||||
void* module; /* not for public access */
|
||||
int mandatory; /* if non-zero, always load and do not make optional */
|
||||
bool supports_feedback; /* if true, protocol has toggleable feedback mechanism */
|
||||
bool (*probe)(ControlProtocolDescriptor*);
|
||||
ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
|
||||
void (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);
|
||||
/* this is required if the control protocol connects to signals
|
||||
from libardour. they all do. It should allocate a
|
||||
type-specific request buffer for the calling thread, and
|
||||
store it in a thread-local location that will be used to
|
||||
find it when sending the event loop a message
|
||||
(e.g. call_slot()). It should also return the allocated
|
||||
buffer as a void*.
|
||||
*/
|
||||
void* (*request_buffer_factory)(uint32_t);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue