Rewrite cxa guard implementation.
authorEric Fiselier <eric@efcs.ca>
Wed, 24 Apr 2019 01:47:30 +0000 (01:47 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 24 Apr 2019 01:47:30 +0000 (01:47 +0000)
commit70ebeabfb8330f805a26dbb2f8af77fb0ab0c5f0
tree3dd9117f8475ea78c3fecad2679bf798dc6371e8
parent0b098754b73f3b96d00ecb1c7605760b11c90298
Rewrite cxa guard implementation.

This patch does three main things:
  (1) It re-writes the cxa guard implementation to make it testable.
  (2) Adds support for recursive init detection on non-apple platforms.
  (3) It adds a futex based implementation.

The futex based implementation locks and notifies on a per-object basis, unlike the
current implementation which uses a global lock for all objects. Once this patch settles
I'll turn it on by default when supported.

llvm-svn: 359060
libcxxabi/src/cxa_guard.cpp
libcxxabi/src/cxa_guard_impl.h [new file with mode: 0644]
libcxxabi/src/include/atomic_support.h
libcxxabi/test/guard_test_basic.pass.cpp [new file with mode: 0644]
libcxxabi/test/guard_threaded_test.pass.cpp [new file with mode: 0644]