[PATCH] Remove support for runtime multithreading

Zachary Turner zturner at google.com
Fri Jun 13 15:01:38 PDT 2014


I tried this once and ran into some difficulty, because before this change,
the Mutex is a pointer which null is an expected value if
llvm_start_multithreaded has not been called.  So the function would have
to return a pointer to the mutex.  That would require changing MutexGuard
to take a pointer instead of a reference, which would generate a ton of
churn.

I'll have another stab at it and see if there's a way to do it in a way
that has very little churn and still contributes to this change as well.


On Fri, Jun 13, 2014 at 2:55 PM, Chandler Carruth <chandlerc at gmail.com>
wrote:

> One more thing to split out, and I think this will actually look good.
>
> ================
> Comment at: lib/Support/ManagedStatic.cpp:27
> @@ -25,3 +26,3 @@
>    if (llvm_is_multithreaded()) {
> -    llvm_acquire_global_lock();
> +    llvm::MutexGuard Lock(llvm_get_global_lock());
>
> ----------------
> This (and the related change to the interface) is the other unrelated
> cleanup that I would like to see separated out from the change which has
> policy effect.
>
> Consider, if we need to revert the runtime control of multithreading for a
> brief period because something breaks, we shouldn't also lose this cleanup
> change.
>
> http://reviews.llvm.org/D4139
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140613/41bfadee/attachment.html>


More information about the llvm-commits mailing list