https://bugs.webkit.org/show_bug.cgi?id=148272
Broke the Mavericks build (Requested by andersca on #webkit).
Reverted changesets:
"Merge Lock and LockBase"
https://bugs.webkit.org/show_bug.cgi?id=148266
http://trac.webkit.org/changeset/188717
"Merge ConditionBase and Condition"
https://bugs.webkit.org/show_bug.cgi?id=148270
http://trac.webkit.org/changeset/188719
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188722
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-08-20 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r188717 and r188719.
+ https://bugs.webkit.org/show_bug.cgi?id=148272
+
+ Broke the Mavericks build (Requested by andersca on #webkit).
+
+ Reverted changesets:
+
+ "Merge Lock and LockBase"
+ https://bugs.webkit.org/show_bug.cgi?id=148266
+ http://trac.webkit.org/changeset/188717
+
+ "Merge ConditionBase and Condition"
+ https://bugs.webkit.org/show_bug.cgi?id=148270
+ http://trac.webkit.org/changeset/188719
+
2015-08-20 Anders Carlsson <andersca@apple.com>
Merge ConditionBase and Condition
template<typename T>
struct Atomic {
- Atomic() = default;
- CONSTEXPR Atomic(T value)
- : value(value)
- {
- }
-
// Don't pass a non-default value for the order parameter unless you really know
// what you are doing and have thought about it very hard. The cost of seq_cst
// is usually not high enough to justify the risk.
// case where no thread is waiting. This condition variable, when used with WTF::Lock, can
// outperform a system condition variable and lock by up to 58x.
-struct Condition {
+// This is a struct without a constructor or destructor so that it can be statically initialized.
+// Use Lock in instance variables.
+struct ConditionBase {
typedef ParkingLot::Clock Clock;
// Wait on a parking queue while releasing the given lock. It will unlock the lock just before
return Clock::now() + myRelativeTimeout;
}
- Atomic<bool> m_hasWaiters { false };
+ Atomic<bool> m_hasWaiters;
};
+class Condition : public ConditionBase {
+ WTF_MAKE_NONCOPYABLE(Condition);
+public:
+ Condition()
+ {
+ m_hasWaiters.store(false);
+ }
+};
+
+typedef ConditionBase StaticCondition;
+
} // namespace WTF
using WTF::Condition;
+using WTF::StaticCondition;
#endif // WTF_Condition_h
static const bool verbose = false;
-void Lock::lockSlow()
+void LockBase::lockSlow()
{
unsigned spinCount = 0;
}
}
-void Lock::unlockSlow()
+void LockBase::unlockSlow()
{
// We could get here because the weak CAS in unlock() failed spuriously, or because there is
// someone parked. So, we need a CAS loop: even if right now the lock is just held, it could
// cannot be acquired in a short period of time, the thread is put to sleep until the lock is available
// again). It uses less memory than a std::mutex.
-struct Lock {
+// This is a struct without a constructor or destructor so that it can be statically initialized.
+// Use Lock in instance variables.
+struct LockBase {
void lock()
{
if (LIKELY(m_byte.compareExchangeWeak(0, isHeldBit, std::memory_order_acquire))) {
return !m_byte.load();
}
- Atomic<uint8_t> m_byte { 0 };
+ Atomic<uint8_t> m_byte;
};
-typedef Locker<Lock> LockHolder;
+class Lock : public LockBase {
+ WTF_MAKE_NONCOPYABLE(Lock);
+public:
+ Lock()
+ {
+ m_byte.store(0, std::memory_order_relaxed);
+ }
+};
-// FIXME: Once all clients have been moved from StaticLock to Lock we can get rid of this typedef.
-typedef Lock StaticLock;
+typedef LockBase StaticLock;
+typedef Locker<LockBase> LockHolder;
} // namespace WTF
class WordLock {
WTF_MAKE_NONCOPYABLE(WordLock);
public:
- CONSTEXPR WordLock() = default;
+ WordLock()
+ {
+ m_word.store(0, std::memory_order_relaxed);
+ }
void lock()
{
return !m_word.load();
}
- Atomic<uintptr_t> m_word { 0 };
+ Atomic<uintptr_t> m_word;
};
typedef Locker<WordLock> WordLockHolder;
+2015-08-20 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r188717 and r188719.
+ https://bugs.webkit.org/show_bug.cgi?id=148272
+
+ Broke the Mavericks build (Requested by andersca on #webkit).
+
+ Reverted changesets:
+
+ "Merge Lock and LockBase"
+ https://bugs.webkit.org/show_bug.cgi?id=148266
+ http://trac.webkit.org/changeset/188717
+
+ "Merge ConditionBase and Condition"
+ https://bugs.webkit.org/show_bug.cgi?id=148270
+ http://trac.webkit.org/changeset/188719
+
2015-08-20 Anders Carlsson <andersca@apple.com>
Merge ConditionBase and Condition
static CFRunLoopRef loaderRunLoopObject = 0;
static StaticLock loaderRunLoopMutex;
-static Condition loaderRunLoopConditionVariable;
+static StaticCondition loaderRunLoopConditionVariable;
static void emptyPerform(void*)
{