diff options
author | Alexey Lapshin <a.v.lapshin@mail.ru> | 2023-04-20 23:03:21 +0200 |
---|---|---|
committer | Alexey Lapshin <a.v.lapshin@mail.ru> | 2023-05-02 18:44:15 +0200 |
commit | 85c2768ce9023ae94d2c70951b3f7e3f33fc2105 (patch) | |
tree | 47e0484165a6be268adfe37e63ccbe850c370577 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 5437a4c5e90886c6688da90eaf70617d50e64895 (diff) | |
download | llvm-85c2768ce9023ae94d2c70951b3f7e3f33fc2105.zip llvm-85c2768ce9023ae94d2c70951b3f7e3f33fc2105.tar.gz llvm-85c2768ce9023ae94d2c70951b3f7e3f33fc2105.tar.bz2 |
[Support][Parallel] Initialize threadIndex and add assertion checking its usage.
That patch adds a check for threadIndex being used with only threads
created by ThreadPoolExecutor. This helps catch two types of errors:
1. If a thread is created not by ThreadPoolExecutor its index may clash
with the index of another thread. Using threadIndex, in that case, may
lead to a data race.
2. Index of the main thread(threadIndex == 0) currently clashes with
the index of thread0 in ThreadPoolExecutor threads. That may lead
to a data race if main thread and thread0 are executed concurrently.
This patch allows execution tasks on the main thread only in case
parallel::strategy.ThreadsRequested == 1. In all other cases,
assertions check that threadIndex != UINT_MAX(i.e. that task
is executed on a thread created by ThreadPoolExecutor).
Differential Revision: https://reviews.llvm.org/D148916
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions