Fix thread_id linkage

This commit is contained in:
Matthias Hochsteger 2019-07-10 15:21:04 +02:00
parent 5fb91f26ed
commit b26286d9cd
2 changed files with 2 additions and 6 deletions

View File

@ -41,8 +41,6 @@ namespace ngcore
__thread int TaskManager :: thread_id;
#endif
thread_local int thread_id = 0;
const function<void(TaskInfo&)> * TaskManager::func;
const function<void()> * TaskManager::startup_function = nullptr;
const function<void()> * TaskManager::cleanup_function = nullptr;
@ -188,12 +186,10 @@ namespace ngcore
num_threads = 1;
}
/*
int TaskManager :: GetThreadId()
{
return thread_id;
}
*/
void TaskManager :: StartWorkers()
{
@ -293,7 +289,7 @@ namespace ngcore
TaskInfo ti;
ti.task_nr = task.mynr;
ti.ntasks = task.total;
ti.thread_nr = thread_id;
ti.thread_nr = TaskManager::GetThreadId();
ti.nthreads = TaskManager::GetNumThreads();
/*
{

View File

@ -98,7 +98,7 @@ namespace ngcore
NGCORE_API static int GetMaxThreads() { return max_threads; }
// static int GetNumThreads() { return task_manager ? task_manager->num_threads : 1; }
NGCORE_API static int GetNumThreads() { return num_threads; }
NGCORE_API static int GetThreadId() { return thread_id; }
NGCORE_API static int GetThreadId();
NGCORE_API int GetNumNodes() const { return num_nodes; }
static void SetPajeTrace (bool use) { use_paje_trace = use; }