[PATCH] D34918: [libc++] Avoid atomic built-ins for NO_THREADS build

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 05:47:06 PDT 2017


On Wed, Jul 05, 2017 at 02:51:28PM -0600, Jonathan Roelofs via llvm-commits wrote:
> > I haven't seen this on bare-metal though, I think it works for Linux
> > platforms. Not 100% sure. Adding Renato for comments.
> 
> Yeah, it can be implemented via a syscall on linux, but on baremetal you
> have to disable/re-enable interrupts in order to have something that behaves
> like compare & swap.

Non-SMP embedded CPUs could get a trivial implementation yes. I think
that's actually preferable to adding more workarounds in libc++.

Joerg


More information about the llvm-commits mailing list