Skip to content

Commit d105785

Browse files
author
kbengine
committed
git-svn-id: https://kbengine.svn.sourceforge.net/svnroot/kbengine@255 d26bdfbe-e24b-4f15-971f-8e0596e1bc08
1 parent 6dae43f commit d105785

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎kbe/src/lib/entitydef/property.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ PropertyDescription::PropertyDescription(std::string dataTypeName, std::string n
2626
if(dataType != NULL)
2727
defaultVal_ = dataType->parseDefaultStr(defaultStr);
2828
else
29+
{
2930
ERROR_MSG("PropertyDescription::PropertyDescription: %s DataType is NULL, in property[%s].\n",
3031
dataTypeName.c_str(), name_.c_str());
32+
}
3133
}
3234

3335
//-------------------------------------------------------------------------------------

‎kbe/src/lib/thread/threadpool.cpp‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ THREAD_ID TPThread::createThread(void)
1414
&TPThread::threadFunc, (void*)this, NULL, 0);
1515
#else
1616
if(pthread_create(&tidp_, NULL, TPThread::threadFunc,
17-
(void*)this)!= 0)
17+
(void*)this)!= 0){
1818
ERROR_MSG("createThread is error!");
19+
}
1920
#endif
2021
return tidp_;
2122
}
@@ -49,9 +50,10 @@ bool ThreadPool::createThreadPool(unsigned int inewThreadCount,
4950
for(unsigned int i=0; i<normalThreadCount_; i++)
5051
{
5152
TPThread* tptd = createThread();
52-
if(!tptd)
53+
if(!tptd){
5354
ERROR_MSG("ThreadPool:: create Thread error! \n");
54-
55+
}
56+
5557
currentFreeThreadCount_++;
5658
currentThreadCount_++;
5759
freeThreadList_.push_back(tptd); // 闲置的线程列表
@@ -141,11 +143,13 @@ bool ThreadPool::removeHangThread(TPThread* tptd)
141143
itr = find(freeThreadList_.begin(), freeThreadList_.end(), tptd);
142144
itr1 = find(allThreadList_.begin(), allThreadList_.end(), tptd);
143145

144-
if(itr != freeThreadList_.end()&& itr1 != allThreadList_.end()){
146+
if(itr != freeThreadList_.end()&& itr1 != allThreadList_.end())
147+
{
145148
freeThreadList_.erase(itr);
146149
allThreadList_.erase(itr1);
147150
currentThreadCount_--;
148151
currentFreeThreadCount_--;
152+
149153
INFO_MSG("ThreadPool::removeHangThread: thread.%u is destroy. "
150154
"currentFreeThreadCount:%d, currentThreadCount:%d\n", \
151155
(unsigned int)tptd->getID(), currentFreeThreadCount_, currentThreadCount_);
@@ -247,7 +251,8 @@ bool TPThread::onWaitCondSignal(void)
247251
threadPool_->removeHangThread(this); // 通知ThreadPool注销自己
248252
return false;
249253
}
250-
else if(ret != WAIT_OBJECT_0){
254+
else if(ret != WAIT_OBJECT_0)
255+
{
251256
ERROR_MSG("WaitForSingleObject is error, ret=%d\n", ret);
252257
}
253258
}

0 commit comments

Comments
 (0)