mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
Fix thread_id linkage
This commit is contained in:
parent
5fb91f26ed
commit
b26286d9cd
@ -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();
|
||||
/*
|
||||
{
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user