mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-07 22:07:28 +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;
|
__thread int TaskManager :: thread_id;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
thread_local int thread_id = 0;
|
|
||||||
|
|
||||||
const function<void(TaskInfo&)> * TaskManager::func;
|
const function<void(TaskInfo&)> * TaskManager::func;
|
||||||
const function<void()> * TaskManager::startup_function = nullptr;
|
const function<void()> * TaskManager::startup_function = nullptr;
|
||||||
const function<void()> * TaskManager::cleanup_function = nullptr;
|
const function<void()> * TaskManager::cleanup_function = nullptr;
|
||||||
@ -188,12 +186,10 @@ namespace ngcore
|
|||||||
num_threads = 1;
|
num_threads = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
int TaskManager :: GetThreadId()
|
int TaskManager :: GetThreadId()
|
||||||
{
|
{
|
||||||
return thread_id;
|
return thread_id;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
void TaskManager :: StartWorkers()
|
void TaskManager :: StartWorkers()
|
||||||
{
|
{
|
||||||
@ -293,7 +289,7 @@ namespace ngcore
|
|||||||
TaskInfo ti;
|
TaskInfo ti;
|
||||||
ti.task_nr = task.mynr;
|
ti.task_nr = task.mynr;
|
||||||
ti.ntasks = task.total;
|
ti.ntasks = task.total;
|
||||||
ti.thread_nr = thread_id;
|
ti.thread_nr = TaskManager::GetThreadId();
|
||||||
ti.nthreads = TaskManager::GetNumThreads();
|
ti.nthreads = TaskManager::GetNumThreads();
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,7 @@ namespace ngcore
|
|||||||
NGCORE_API static int GetMaxThreads() { return max_threads; }
|
NGCORE_API static int GetMaxThreads() { return max_threads; }
|
||||||
// static int GetNumThreads() { return task_manager ? task_manager->num_threads : 1; }
|
// static int GetNumThreads() { return task_manager ? task_manager->num_threads : 1; }
|
||||||
NGCORE_API static int GetNumThreads() { return num_threads; }
|
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; }
|
NGCORE_API int GetNumNodes() const { return num_nodes; }
|
||||||
|
|
||||||
static void SetPajeTrace (bool use) { use_paje_trace = use; }
|
static void SetPajeTrace (bool use) { use_paje_trace = use; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user