![]() |
Audacity 3.2.0
|
Allow messages to be sent from the main thread to the script thread. More...
#include <ResponseQueue.h>
Public Member Functions | |
| ResponseQueue () | |
| ~ResponseQueue () | |
| void | AddResponse (Response response) |
| Response | WaitAndGetResponse () |
Private Attributes | |
| std::queue< Response > | mResponses |
| wxMutex | mMutex |
| wxCondition | mCondition |
Allow messages to be sent from the main thread to the script thread.
Based roughly on wxMessageQueue<T> (which hasn't reached the stable wxwidgets yet). Wraps a std::queue<Response> inside a wxMutex with a wxCondition to force the script thread to wait until a response is available.
Definition at line 60 of file ResponseQueue.h.
| ResponseQueue::ResponseQueue | ( | ) |
Definition at line 22 of file ResponseQueue.cpp.
| ResponseQueue::~ResponseQueue | ( | ) |
Definition at line 26 of file ResponseQueue.cpp.
| void ResponseQueue::AddResponse | ( | Response | response | ) |
Definition at line 29 of file ResponseQueue.cpp.
References mCondition, mMutex, and mResponses.
| Response ResponseQueue::WaitAndGetResponse | ( | ) |
Definition at line 36 of file ResponseQueue.cpp.
References mCondition, mMutex, and mResponses.
|
private |
Definition at line 64 of file ResponseQueue.h.
Referenced by AddResponse(), and WaitAndGetResponse().
|
private |
Definition at line 63 of file ResponseQueue.h.
Referenced by AddResponse(), and WaitAndGetResponse().
|
private |
Definition at line 62 of file ResponseQueue.h.
Referenced by AddResponse(), and WaitAndGetResponse().