1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
Peter Collingbourne
12a5c419d0 Support: Remove MSVC 2013 workarounds in ThreadPool class.
I have confirmed that these are no longer needed with MSVC 2015.

Differential Revision: https://reviews.llvm.org/D34187

llvm-svn: 305347
2017-06-14 00:36:21 +00:00
Davide Italiano
24691c7655 [ThreadPool] Rollback recent changes until I figure out the breakage.
llvm-svn: 288018
2016-11-28 09:17:12 +00:00
Davide Italiano
ada55c7225 [ThreadPool] Simplify the interface. NFCI.
The callers don't use the return value. Found by Michael
Spencer.

llvm-svn: 288016
2016-11-28 08:53:41 +00:00
Jason Henline
c446361f57 Removing whitespace from test commit rL273447
Undoing the trivial change I introduced in rL273447.

llvm-svn: 273449
2016-06-22 18:01:11 +00:00
Jason Henline
918ee3ad43 Add whitespace to check commit access
No functional changes. Just adding whitespace in a comment in order to
check that I am able to push a commit to the repo.

llvm-svn: 273447
2016-06-22 17:40:02 +00:00
Justin Lebar
16ef855476 Fix a race condition in support library ThreadPool.
By running TSAN on the ThreadPool unit tests it was discovered that the
threads in the pool can pop tasks off the queue at the same time the
"wait" routine is trying to check if the task queue is empty. This patch
fixes this problem by checking for active threads in the waiter before
checking whether the queue is empty.

Patch by Jason Henline.

Differential Revision: http://reviews.llvm.org/D18811

Reviewers: joker.eph, jlebar
llvm-svn: 265618
2016-04-06 23:46:40 +00:00
Mehdi Amini
24492edbe4 Fix MSVC build with LLVM_ENABLE_THREADS=OFF
Follow-up to the ThreadPool implementation.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255621
2015-12-15 05:53:41 +00:00
Mehdi Amini
54fc055738 Add a C++11 ThreadPool implementation in LLVM
This is a very simple implementation of a thread pool using C++11
thread. It accepts any std::function<void()> for asynchronous
execution. Individual task can be synchronize using the returned
future, or the client can block on the full queue completion.

In case LLVM is configured with Threading disabled, it falls back
to sequential execution using std::async with launch:deferred.

This is intended to support parallelism for ThinLTO processing in
linker plugin, but is generic enough for any other uses.

This is a recommit of r255444 ; trying to workaround a bug in the
MSVC 2013 standard library. I think I was hit by:

 http://connect.microsoft.com/VisualStudio/feedbackdetail/view/791185/std-packaged-task-t-where-t-is-void-or-a-reference-class-are-not-movable

Recommit of r255589, trying to please g++ as well.

Differential Revision: http://reviews.llvm.org/D15464

From: mehdi_amini <mehdi_amini@91177308-0d34-0410-b5e6-96231b3b80d8>
llvm-svn: 255593
2015-12-15 00:59:19 +00:00
Mehdi Amini
5acecbc1ec Revert "Add a C++11 ThreadPool implementation in LLVM"
This reverts commit r255589. Breaks g++

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255591
2015-12-15 00:42:44 +00:00
Mehdi Amini
dbdd929681 Add a C++11 ThreadPool implementation in LLVM
This is a very simple implementation of a thread pool using C++11
thread. It accepts any std::function<void()> for asynchronous
execution. Individual task can be synchronize using the returned
future, or the client can block on the full queue completion.

In case LLVM is configured with Threading disabled, it falls back
to sequential execution using std::async with launch:deferred.

This is intended to support parallelism for ThinLTO processing in
linker plugin, but is generic enough for any other uses.

This is a recommit of r255444 ; trying to workaround a bug in the
MSVC 2013 standard library. I think I was hit by:

 http://connect.microsoft.com/VisualStudio/feedbackdetail/view/791185/std-packaged-task-t-where-t-is-void-or-a-reference-class-are-not-movable

Differential Revision: http://reviews.llvm.org/D15464

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255589
2015-12-15 00:38:05 +00:00
Nico Weber
c244167f92 Revert r255444.
It doesn't build on Windows and broke the Windows LLD and LLDB bots:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/27693/steps/build_Lld/logs/stdio
http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/13468/steps/build/logs/stdio

llvm-svn: 255446
2015-12-13 04:14:39 +00:00
Mehdi Amini
865fad06c6 Add a C++11 ThreadPool implementation in LLVM
This is a very simple implementation of a thread pool using C++11
thread. It accepts any std::function<void()> for asynchronous
execution. Individual task can be synchronize using the returned
future, or the client can block on the full queue completion.

In case LLVM is configured with Threading disabled, it falls back
to sequential execution using std::async with launch:deferred.

This is intended to support parallelism for ThinLTO processing in
linker plugin, but is generic enough for any other uses.

Differential Revision: http://reviews.llvm.org/D15464

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255444
2015-12-12 22:55:25 +00:00