Skip to content

Commit b371622

Browse files
committed
修正db线程进行DBUtil::finiThread()的时候可能会在主线程中执行的bug。
1 parent 6aeabe4 commit b371622

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎kbe/src/server/dbmgr/db_threadpool.cpp‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ class DBThread : public thread::TPThread
4343
ERROR_MSG("DBThread:: can't create dbinterface!\n");
4444
}
4545

46-
DEBUG_MSG(boost::format("DBThread:: %1% started!\n") % this);
46+
DEBUG_MSG(boost::format("DBThread::onStart(): %1%!\n") % this);
4747
}
4848

49-
~DBThread()
49+
virtual void onEnd()
5050
{
5151
if(_pDBInterface)
5252
{
@@ -55,7 +55,11 @@ class DBThread : public thread::TPThread
5555
DBUtil::finiThread();
5656
}
5757

58-
DEBUG_MSG(boost::format("DBThread:: %1% end!\n") % this);
58+
DEBUG_MSG(boost::format("DBThread::onEnd(): %1%!\n") % this);
59+
}
60+
61+
~DBThread()
62+
{
5963
}
6064

6165
virtual void onProcessTaskStart(thread::TPTask* pTask)

0 commit comments

Comments
 (0)