Skip to content

Commit 932bcd5

Browse files
committed
Fix build
1 parent 0a1126c commit 932bcd5

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

Logger/it/Logger_IT.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ TEST(Logger_IT, FlushTime)
156156
// Clear the m_msgData list on Logger thread
157157
auto retVal1 = MakeDelegate(
158158
&Logger::GetInstance().m_logData.m_msgData, // Object instance
159-
&std::list<std::string>::clear, // Object function
159+
(void (std::list<std::string>::*)() noexcept)&std::list<std::string>::clear, // Object function
160160
Logger::GetInstance(), // Thread to invoke object function
161161
milliseconds(50)).AsyncInvoke();
162162

@@ -222,7 +222,7 @@ TEST(Logger_IT, FlushTimeSimplified)
222222
// Clear the m_msgData list on Logger thread
223223
auto retVal1 = AsyncInvoke(
224224
&Logger::GetInstance().m_logData.m_msgData, // Object instance
225-
&std::list<std::string>::clear, // Object function
225+
(void (std::list<std::string>::*)() noexcept)&std::list<std::string>::clear, // Object function
226226
Logger::GetInstance(), // Thread to invoke object function
227227
milliseconds(50)); // Wait up to 50mS for async invoke
228228

@@ -290,7 +290,7 @@ TEST(Logger_IT, FlushTimeSimplifiedWithLambda)
290290
// Clear the m_msgData list on Logger thread
291291
auto retVal1 = AsyncInvoke(
292292
&Logger::GetInstance().m_logData.m_msgData, // Object instance
293-
&std::list<std::string>::clear, // Object function
293+
(void (std::list<std::string>::*)() noexcept)&std::list<std::string>::clear, // Object function
294294
Logger::GetInstance(), // Thread to invoke object function
295295
milliseconds(50)); // Wait up to 50mS for async invoke
296296

@@ -454,4 +454,4 @@ TEST(Logger_IT, ConcurrentWrites)
454454
}
455455

456456
// Dummy function to force linker to keep the code in this file
457-
void Logger_IT_ForceLink() { }
457+
void Logger_IT_ForceLink() { }

Logger/src/Logger.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ void Logger::ExitThread()
157157
// DispatchDelegate
158158
//----------------------------------------------------------------------------
159159
#ifdef IT_ENABLE
160-
void Logger::DispatchDelegate(std::shared_ptr<dmq::DelegateMsg> msg)
160+
bool Logger::DispatchDelegate(std::shared_ptr<dmq::DelegateMsg> msg)
161161
{
162+
if (!m_thread) return false;
162163
ASSERT_TRUE(m_thread);
163164

164165
// Create a new ThreadMsg
@@ -168,6 +169,7 @@ void Logger::DispatchDelegate(std::shared_ptr<dmq::DelegateMsg> msg)
168169
std::unique_lock<std::mutex> lk(m_mutex);
169170
m_queue.push(threadMsg);
170171
m_cv.notify_one();
172+
return true;
171173
}
172174
#endif
173175

@@ -290,3 +292,4 @@ void Logger::Process()
290292
}
291293
}
292294

295+

Logger/src/Logger.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Logger
3737
}
3838

3939
#ifdef IT_ENABLE
40-
virtual void DispatchDelegate(std::shared_ptr<dmq::DelegateMsg> msg);
40+
virtual bool DispatchDelegate(std::shared_ptr<dmq::DelegateMsg> msg);
4141
virtual bool IsCurrentThread() override { return GetThreadId() == GetCurrentThreadId(); }
4242
#endif
4343

@@ -88,3 +88,4 @@ IT_PRIVATE_ACCESS :
8888

8989
#endif
9090

91+

0 commit comments

Comments
 (0)