|
17 | 17 | * simplifies the registration of PTZDevice methods as targets for |
18 | 18 | * proc_handler calls. |
19 | 19 | * |
20 | | - * In this current implementation, the proc_handler must be called from |
21 | | - * the GUI thread. If called from another thread it will output a |
22 | | - * warning and return without action. It is done this way because the |
23 | | - * calldata_t* is transient and owned by the calling thread, but Qt |
24 | | - * objects need to be called from their own thread, and calldata would |
25 | | - * be stale if the call was queued with QMetaObject::invokeMethod() |
26 | | - * |
27 | | - * This isn't ideal, as there are places where other plugins may want to |
28 | | - * make calls from their own threads. The rule can be relaxed on a call |
29 | | - * by call basis if the method is made thread safe. |
| 20 | + * In this current implementation, the proc_handler can be called from |
| 21 | + * any thread, and the calldata method must decode the arguments and use |
| 22 | + * invokeMethod to call the real target. invokeMethod will check if it |
| 23 | + * was called from the object's thread. If it wasn't, and if the method |
| 24 | + * doesn't return anything, then the call is queued on the correct |
| 25 | + * thread. For methods that do return data, they aren't handled yet and |
| 26 | + * will log an error when calling from a different thread. |
30 | 27 | */ |
31 | 28 | #define ptz_ph_lambda(_method) [](void *p, calldata_t *cd) \ |
32 | 29 | { \ |
@@ -202,7 +199,7 @@ void PTZDevice::move_rel(calldata_t *cd) |
202 | 199 | void PTZDevice::get(calldata_t *cd) const |
203 | 200 | { |
204 | 201 | if (QThread::currentThread() != thread()) { |
205 | | - ptz_log(LOG_ERROR, "PTZDevice::get(calldata) called from non-GUI thread; ignored"); |
| 202 | + ptz_log(LOG_ERROR, "PTZDevice::get(calldata) called from wrong thread; ignored"); |
206 | 203 | return; |
207 | 204 | } |
208 | 205 | QString arg = calldata_string(cd, "property"); |
|
0 commit comments