[WTF] Remove XXXLockBase since constexpr constructor can initialize static variables...
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Dec 2017 03:52:09 +0000 (03:52 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Dec 2017 03:52:09 +0000 (03:52 +0000)
commit98d24a3187ec14542d7d53946efae649806704c3
tree64942179311568166343735e3d41c00752def318
parentb50f363c7e2aecf656f200023c9b134d40088555
[WTF] Remove XXXLockBase since constexpr constructor can initialize static variables without calling global constructors
https://bugs.webkit.org/show_bug.cgi?id=180495

Reviewed by Mark Lam.

Very nice feature of C++11 is that constexpr constructor can initialize static global variables
without calling global constructors. We do not need to have XXXLockBase with derived XXXLock
class since StaticXXXLock can have constructors as long as it is constexpr.
We remove bunch of these classes, and set `XXXLock() = default;` explicitly for readability.
C++11's default constructor is constexpr as long as its member's default constructor / default
initializer is constexpr.

* wtf/Condition.h:
(WTF::ConditionBase::construct): Deleted.
(WTF::ConditionBase::waitUntil): Deleted.
(WTF::ConditionBase::waitFor): Deleted.
(WTF::ConditionBase::wait): Deleted.
(WTF::ConditionBase::notifyOne): Deleted.
(WTF::ConditionBase::notifyAll): Deleted.
(WTF::Condition::Condition): Deleted.
* wtf/CountingLock.h:
(WTF::CountingLock::CountingLock): Deleted.
(WTF::CountingLock::~CountingLock): Deleted.
* wtf/Lock.cpp:
(WTF::Lock::lockSlow):
(WTF::Lock::unlockSlow):
(WTF::Lock::unlockFairlySlow):
(WTF::Lock::safepointSlow):
(WTF::LockBase::lockSlow): Deleted.
(WTF::LockBase::unlockSlow): Deleted.
(WTF::LockBase::unlockFairlySlow): Deleted.
(WTF::LockBase::safepointSlow): Deleted.
* wtf/Lock.h:
(WTF::LockBase::construct): Deleted.
(WTF::LockBase::lock): Deleted.
(WTF::LockBase::tryLock): Deleted.
(WTF::LockBase::try_lock): Deleted.
(WTF::LockBase::unlock): Deleted.
(WTF::LockBase::unlockFairly): Deleted.
(WTF::LockBase::safepoint): Deleted.
(WTF::LockBase::isHeld const): Deleted.
(WTF::LockBase::isLocked const): Deleted.
(WTF::LockBase::isFullyReset const): Deleted.
(WTF::Lock::Lock): Deleted.
* wtf/ReadWriteLock.cpp:
(WTF::ReadWriteLock::readLock):
(WTF::ReadWriteLock::readUnlock):
(WTF::ReadWriteLock::writeLock):
(WTF::ReadWriteLock::writeUnlock):
(WTF::ReadWriteLockBase::construct): Deleted.
(WTF::ReadWriteLockBase::readLock): Deleted.
(WTF::ReadWriteLockBase::readUnlock): Deleted.
(WTF::ReadWriteLockBase::writeLock): Deleted.
(WTF::ReadWriteLockBase::writeUnlock): Deleted.
* wtf/ReadWriteLock.h:
(WTF::ReadWriteLock::read):
(WTF::ReadWriteLock::write):
(WTF::ReadWriteLockBase::ReadLock::tryLock): Deleted.
(WTF::ReadWriteLockBase::ReadLock::lock): Deleted.
(WTF::ReadWriteLockBase::ReadLock::unlock): Deleted.
(WTF::ReadWriteLockBase::WriteLock::tryLock): Deleted.
(WTF::ReadWriteLockBase::WriteLock::lock): Deleted.
(WTF::ReadWriteLockBase::WriteLock::unlock): Deleted.
(WTF::ReadWriteLockBase::read): Deleted.
(WTF::ReadWriteLockBase::write): Deleted.
(WTF::ReadWriteLock::ReadWriteLock): Deleted.
* wtf/RecursiveLockAdapter.h:
(WTF::RecursiveLockAdapter::RecursiveLockAdapter): Deleted.
* wtf/WordLock.cpp:
(WTF::WordLock::lockSlow):
(WTF::WordLock::unlockSlow):
(WTF::WordLockBase::lockSlow): Deleted.
(WTF::WordLockBase::unlockSlow): Deleted.
* wtf/WordLock.h:
(WTF::WordLockBase::lock): Deleted.
(WTF::WordLockBase::unlock): Deleted.
(WTF::WordLockBase::isHeld const): Deleted.
(WTF::WordLockBase::isLocked const): Deleted.
(WTF::WordLockBase::isFullyReset const): Deleted.
(WTF::WordLock::WordLock): Deleted.
* wtf/WorkQueue.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/Condition.h
Source/WTF/wtf/CountingLock.h
Source/WTF/wtf/Lock.cpp
Source/WTF/wtf/Lock.h
Source/WTF/wtf/ReadWriteLock.cpp
Source/WTF/wtf/ReadWriteLock.h
Source/WTF/wtf/RecursiveLockAdapter.h
Source/WTF/wtf/WordLock.cpp
Source/WTF/wtf/WordLock.h
Source/WTF/wtf/WorkQueue.cpp [changed mode: 0755->0644]