[PATCH] Remove support for enabling / disabling multi-threading at runtime.
David Blaikie
dblaikie at gmail.com
Mon Jun 9 16:11:15 PDT 2014
On Mon, Jun 9, 2014 at 4:07 PM, Reid Kleckner <rnk at google.com> wrote:
> Nice! I want to get a little more support for this direction before committing. Let me try to rope in some appropriate people. In the meantime, I had some comments.
>
> ================
> Comment at: include/llvm-c/Core.h:2856
> @@ -2855,3 @@
> - @see llvm::llvm_start_multithreaded */
> -LLVMBool LLVMStartMultithreaded(void);
> -
> ----------------
> The C API is one of the few places where we have hard ABI stability guarantees. These should become no-op stubs.
>
> ================
> Comment at: include/llvm/Support/Threading.h:38
> @@ +37,3 @@
> + /// llvm_get_global_lock() - returns the llvm global lock object.
> + llvm::recursive_mutex& llvm_get_global_lock();
> +
> ----------------
> nit: LLVM is in the 'star-on-the-right' camp.
clang-format can handle this sort of thing for you. There are scripts
to run it over your current diff or git revision, etc.
>
> ================
> Comment at: lib/Support/Threading.cpp:28-32
> @@ -27,13 +27,7 @@
> +bool llvm::llvm_is_multithreaded() {
> #if LLVM_ENABLE_THREADS != 0
> - assert(!multithreaded_mode && "Already multithreaded!");
> - multithreaded_mode = true;
> - global_lock = new sys::Mutex(true);
> -
> - // We fence here to ensure that all initialization is complete BEFORE we
> - // return from llvm_start_multithreaded().
> - sys::MemoryFence();
> return true;
> #else
> return false;
> #endif
> }
> ----------------
> return bool(LLVM_ENABLE_THREADS) ?
>
> http://reviews.llvm.org/D4076
>
>
More information about the llvm-commits
mailing list