Skip to content

Commit

Permalink
修复adminRegistry线程过多
Browse files Browse the repository at this point in the history
  • Loading branch information
loveyacper committed Oct 26, 2017
1 parent 9e8f03a commit bd8ac1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cpp/framework/AdminRegistryServer/ExecuteTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,20 @@ void TaskListParallel::doTask(TaskItemReq req, size_t index)

ExecuteTask::ExecuteTask()
{
_terminate = false;
start();
}

ExecuteTask::~ExecuteTask()
{
terminate();
}

void ExecuteTask::terminate()
{
_terminate = true;
TC_LockT<TC_ThreadLock> lock(*this);
notifyAll();
}

void ExecuteTask::run()
Expand Down
2 changes: 2 additions & 0 deletions cpp/framework/AdminRegistryServer/ExecuteTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class ExecuteTask : public TC_Singleton<ExecuteTask>, public TC_ThreadLock, publ

virtual void run();

void terminate();

/**
* 添加任务请求
*
Expand Down

0 comments on commit bd8ac1f

Please sign in to comment.