mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-28 09:34:16 +00:00
RunnableServiceWithWork::StopWorkAndFinishTasks added
This commit is contained in:
+9
-2
@@ -141,12 +141,13 @@ namespace util
|
||||
}
|
||||
}
|
||||
|
||||
void RunnableService::StopIOService ()
|
||||
void RunnableService::StopIOService (bool stopService)
|
||||
{
|
||||
if (m_IsRunning)
|
||||
{
|
||||
m_IsRunning = false;
|
||||
m_Service.stop ();
|
||||
if (stopService)
|
||||
m_Service.stop ();
|
||||
if (m_Thread)
|
||||
{
|
||||
m_Thread->join ();
|
||||
@@ -180,6 +181,12 @@ namespace util
|
||||
m_Name = name.substr(0,15);
|
||||
}
|
||||
|
||||
void RunnableServiceWithWork::StopWorkAndFinishTasks ()
|
||||
{
|
||||
m_Work.reset ();
|
||||
StopIOService (false);
|
||||
}
|
||||
|
||||
void SetThreadName (const char *name) {
|
||||
#if defined(__APPLE__)
|
||||
# if (!defined(MAC_OS_X_VERSION_10_6) || \
|
||||
|
||||
Reference in New Issue
Block a user