fix bug when disable PARALLEL_TRANSFORM

This commit is contained in:
windy 2021-10-10 23:10:46 +08:00
parent 05b4d14444
commit 4fca1ebca7
2 changed files with 11 additions and 3 deletions

View file

@ -9,7 +9,11 @@
// Determine whether or not to use thread pooling for tasks.
//
#ifndef VTIL_USE_THREAD_POOLING
#define VTIL_USE_THREAD_POOLING true
#ifdef _DEBUG
#define VTIL_USE_THREAD_POOLING false
#else
#define VTIL_USE_THREAD_POOLING true
#endif
#endif
namespace vtil::task

View file

@ -36,7 +36,11 @@
// Determine whether or not to use parallel transformations.
//
#ifndef VTIL_USE_PARALLEL_TRANSFORM
#define VTIL_USE_PARALLEL_TRANSFORM true
#if _DEBUG
#define VTIL_USE_PARALLEL_TRANSFORM false
#else
#define VTIL_USE_PARALLEL_TRANSFORM true
#endif
#endif
namespace vtil
@ -66,7 +70,7 @@ namespace vtil
if ( !VTIL_USE_PARALLEL_TRANSFORM || container_size == 1 )
{
for ( auto it = std::begin( container ); it != std::end( container ); ++it )
return worker( *it );
worker( *it );
}
// Otherwise, create task pool and insert for each entry.
//