<div dir="ltr">We could also add a static assert into our ThreadPool to enforce the constraint - so we all get a builbreak, rather than committing only to get a Windows buildbot failmail.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 11, 2020 at 3:00 AM Benjamin Kramer via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If you don't find a workaround we should probably add a comment. I've<br>
been here before<br>
<a href="https://github.com/llvm/llvm-project/commit/6baaa4be7831ffacc775b421dbc845d6ca6e89b8" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/6baaa4be7831ffacc775b421dbc845d6ca6e89b8</a><br>
<br>
On Thu, Sep 10, 2020 at 8:53 PM Lang Hames via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
><br>
> Author: Lang Hames<br>
> Date: 2020-09-10T11:53:09-07:00<br>
> New Revision: 54fcea86b1658f5fc70f4f1e7a763f87742d79bc<br>
><br>
> URL: <a href="https://github.com/llvm/llvm-project/commit/54fcea86b1658f5fc70f4f1e7a763f87742d79bc" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/54fcea86b1658f5fc70f4f1e7a763f87742d79bc</a><br>
> DIFF: <a href="https://github.com/llvm/llvm-project/commit/54fcea86b1658f5fc70f4f1e7a763f87742d79bc.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/54fcea86b1658f5fc70f4f1e7a763f87742d79bc.diff</a><br>
><br>
> LOG: Revert "[Support] Use unique_function rather than std::function for ThreadPool TaskTy."<br>
><br>
> This reverts commit d9c8b0256cfc673c2413b13993c9440be598818f.<br>
><br>
> Some MSVC std::packaged_task implementations are not compatible with move-only types.<br>
> This caused failures on some of the Windows builders (e.g.<br>
> <a href="http://lab.llvm.org:8011/builders/sanitizer-windows/builds/69412" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/sanitizer-windows/builds/69412</a>).<br>
><br>
> Reverting until I can come up with a workaround.<br>
><br>
> Added:<br>
><br>
><br>
> Modified:<br>
>     llvm/include/llvm/Support/ThreadPool.h<br>
>     llvm/unittests/Support/ThreadPool.cpp<br>
><br>
> Removed:<br>
><br>
><br>
><br>
> ################################################################################<br>
> diff  --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h<br>
> index 3d24fb099739..528fb32525eb 100644<br>
> --- a/llvm/include/llvm/Support/ThreadPool.h<br>
> +++ b/llvm/include/llvm/Support/ThreadPool.h<br>
> @@ -13,7 +13,6 @@<br>
>  #ifndef LLVM_SUPPORT_THREAD_POOL_H<br>
>  #define LLVM_SUPPORT_THREAD_POOL_H<br>
><br>
> -#include "llvm/ADT/FunctionExtras.h"<br>
>  #include "llvm/Config/llvm-config.h"<br>
>  #include "llvm/Support/Threading.h"<br>
>  #include "llvm/Support/thread.h"<br>
> @@ -37,7 +36,7 @@ namespace llvm {<br>
>  /// for some work to become available.<br>
>  class ThreadPool {<br>
>  public:<br>
> -  using TaskTy = unique_function<void()>;<br>
> +  using TaskTy = std::function<void()>;<br>
>    using PackagedTaskTy = std::packaged_task<void()>;<br>
><br>
>    /// Construct a pool using the hardware strategy \p S for mapping hardware<br>
><br>
> diff  --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp<br>
> index b3747376689a..43882d0f3cee 100644<br>
> --- a/llvm/unittests/Support/ThreadPool.cpp<br>
> +++ b/llvm/unittests/Support/ThreadPool.cpp<br>
> @@ -133,13 +133,6 @@ TEST_F(ThreadPoolTest, Async) {<br>
>    ASSERT_EQ(2, i.load());<br>
>  }<br>
><br>
> -TEST_F(ThreadPoolTest, NonCopyableTask) {<br>
> -  CHECK_UNSUPPORTED();<br>
> -  ThreadPool Pool;<br>
> -  Pool.async([P = std::make_unique<int>()] {});<br>
> -  Pool.wait();<br>
> -};<br>
> -<br>
>  TEST_F(ThreadPoolTest, GetFuture) {<br>
>    CHECK_UNSUPPORTED();<br>
>    ThreadPool Pool(hardware_concurrency(2));<br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>