You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-02 17:22:27 +03:00
MCOL-513 Optimize by replacing make_pair with a struct
This commit is contained in:
@ -20,7 +20,6 @@
|
||||
*
|
||||
*
|
||||
***********************************************************************/
|
||||
#define NOLOGGING
|
||||
#include <stdexcept>
|
||||
using namespace std;
|
||||
|
||||
@ -128,7 +127,7 @@ void ThreadPool::join(uint64_t thrHandle)
|
||||
for (iter = fWaitingFunctors.begin(); iter != end; ++iter)
|
||||
{
|
||||
foundit = false;
|
||||
if (iter->first == thrHandle)
|
||||
if (iter->hndl == thrHandle)
|
||||
{
|
||||
foundit = true;
|
||||
break;
|
||||
@ -158,7 +157,7 @@ void ThreadPool::join(std::vector<uint64_t> thrHandle)
|
||||
std::vector<uint64_t>::iterator thrEnd = thrHandle.end();
|
||||
for (thrIter = thrHandle.begin(); thrIter != thrEnd; ++thrIter)
|
||||
{
|
||||
if (iter->first == *thrIter)
|
||||
if (iter->hndl == *thrIter)
|
||||
{
|
||||
foundit = true;
|
||||
break;
|
||||
@ -282,7 +281,7 @@ void ThreadPool::beginThread() throw()
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
try {
|
||||
(*todoList[i]).second();
|
||||
(*todoList[i]).functor();
|
||||
}
|
||||
catch(exception &e) {
|
||||
++fFunctorErrors;
|
||||
@ -366,7 +365,11 @@ int64_t ThreadPool::addFunctor(const Functor_T &func)
|
||||
if (fNextFunctor == fWaitingFunctors.end())
|
||||
bAtEnd = true;
|
||||
|
||||
fWaitingFunctors.push_back(make_pair(fNextHandle, func));
|
||||
// PoolFunction_T poolFunction(fNextHandle, func);
|
||||
PoolFunction_T poolFunction;
|
||||
poolFunction.hndl = fNextHandle;
|
||||
poolFunction.functor = func;
|
||||
fWaitingFunctors.push_back(poolFunction);
|
||||
waitingFunctorsSize++;
|
||||
if (bAtEnd)
|
||||
{
|
||||
|
Reference in New Issue
Block a user