From 2a326b5bbff91ffaedd9017f388aa45862047743 Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Tue, 19 Mar 2019 10:11:01 +0000 Subject: MLCE-105 Fix use of std::unique_lock in LoadedNetwork You can't use a unique_lock to check lock ownership by a particular thread - it just checks whether the mutex is locked by that lock. Change-Id: I28190dc3bea91b3cc68f9b9381751e70fd70f43f Signed-off-by: Matthew Bentham --- src/armnn/LoadedNetwork.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/armnn/LoadedNetwork.hpp') diff --git a/src/armnn/LoadedNetwork.hpp b/src/armnn/LoadedNetwork.hpp index 03a741fb75..9c0fe0b108 100644 --- a/src/armnn/LoadedNetwork.hpp +++ b/src/armnn/LoadedNetwork.hpp @@ -47,10 +47,11 @@ public: // the shared_ptr's reference counter const std::shared_ptr& GetProfiler() const { return m_Profiler; } - void AllocateWorkingMemory(); void FreeWorkingMemory(); private: + void AllocateWorkingMemory(); + LoadedNetwork(std::unique_ptr net); void EnqueueInput(const BindableLayer& layer, ITensorHandle* tensorHandle, const TensorInfo& tensorInfo); @@ -77,9 +78,7 @@ private: WorkloadQueue m_OutputQueue; std::shared_ptr m_Profiler; - using UniqueMutexLock = std::unique_lock; mutable std::mutex m_WorkingMemMutex; - UniqueMutexLock m_WorkingMemLock; bool m_IsWorkingMemAllocated=false; }; -- cgit v1.2.1