libcamera: thread: Enforce dispatchMessages() call context with assert
The Thread::dispatchMessages() function is meant to be called from within the thread only. Catch incorrect usage with an ASSERT(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
This commit is contained in:
@@ -560,6 +560,8 @@ void Thread::removeMessages(Object *receiver)
|
||||
*/
|
||||
void Thread::dispatchMessages(Message::Type type)
|
||||
{
|
||||
ASSERT(data_ == ThreadData::current());
|
||||
|
||||
MutexLocker locker(data_->messages_.mutex_);
|
||||
|
||||
std::list<std::unique_ptr<Message>> &messages = data_->messages_.list_;
|
||||
|
||||
Reference in New Issue
Block a user