Remove WTF's BinarySemaphore
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Dec 2013 00:31:11 +0000 (00:31 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Dec 2013 00:31:11 +0000 (00:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126310

Reviewed by Anders Carlsson.

It's unused. Also remove the now empty wtf/threads directory.

* GNUmakefile.list.am:
* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/PlatformWin.cmake:
* wtf/threads: Removed.
* wtf/threads/BinarySemaphore.cpp: Removed.
* wtf/threads/BinarySemaphore.h: Removed.
* wtf/threads/win: Removed.
* wtf/threads/win/BinarySemaphoreWin.cpp: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161160 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/WTF.vcxproj/WTF.vcxproj
Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/Forward.h
Source/WTF/wtf/PlatformWin.cmake
Source/WTF/wtf/threads/BinarySemaphore.cpp [deleted file]
Source/WTF/wtf/threads/BinarySemaphore.h [deleted file]
Source/WTF/wtf/threads/win/BinarySemaphoreWin.cpp [deleted file]

index 1537c07..5586e19 100644 (file)
@@ -1,3 +1,25 @@
+2013-12-30  Sam Weinig  <sam@webkit.org>
+
+        Remove WTF's BinarySemaphore
+        https://bugs.webkit.org/show_bug.cgi?id=126310
+
+        Reviewed by Anders Carlsson.
+
+        It's unused. Also remove the now empty wtf/threads directory.
+
+        * GNUmakefile.list.am:
+        * WTF.vcxproj/WTF.vcxproj:
+        * WTF.vcxproj/WTF.vcxproj.filters:
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/Forward.h:
+        * wtf/PlatformWin.cmake:
+        * wtf/threads: Removed.
+        * wtf/threads/BinarySemaphore.cpp: Removed.
+        * wtf/threads/BinarySemaphore.h: Removed.
+        * wtf/threads/win: Removed.
+        * wtf/threads/win/BinarySemaphoreWin.cpp: Removed.
+
 2013-12-30  Roger Fong  <roger_fong@apple.com>
 
         [Windows] Unreviewed build fix following r160959.
index 767e291..9b2d59f 100644 (file)
@@ -244,8 +244,6 @@ wtf_sources += \
     Source/WTF/wtf/text/TextPosition.h \
     Source/WTF/wtf/text/WTFString.cpp \
     Source/WTF/wtf/text/WTFString.h \
-    Source/WTF/wtf/threads/BinarySemaphore.cpp \
-    Source/WTF/wtf/threads/BinarySemaphore.h \
     Source/WTF/wtf/unicode/CharacterNames.h \
     Source/WTF/wtf/unicode/Collator.h \
     Source/WTF/wtf/unicode/CollatorDefault.cpp \
index 699e774..61c5a92 100644 (file)
     <ClCompile Include="..\wtf\Threading.cpp" />
     <ClCompile Include="..\wtf\ThreadingWin.cpp" />
     <ClCompile Include="..\wtf\threadspecificWin.cpp" />
-    <ClCompile Include="..\wtf\threads\BinarySemaphore.cpp" />
-    <ClCompile Include="..\wtf\threads\win\BinarySemaphoreWin.cpp" />
     <ClCompile Include="..\wtf\unicode\icu\CollatorICU.cpp" />
     <ClCompile Include="..\wtf\unicode\UTF8.cpp" />
     <ClCompile Include="..\wtf\win\MainThreadWin.cpp" />
     <ClInclude Include="..\wtf\ThreadRestrictionVerifier.h" />
     <ClInclude Include="..\wtf\threadsafeRefCounted.h" />
     <ClInclude Include="..\wtf\threadspecific.h" />
-    <ClInclude Include="..\wtf\threads\BinarySemaphore.h" />
     <ClInclude Include="..\wtf\unicode\CharacterNames.h" />
     <ClInclude Include="..\wtf\unicode\Collator.h" />
     <ClInclude Include="..\wtf\unicode\icu\UnicodeIcu.h" />
index 7b7f1d4..4b5e601 100644 (file)
     <ClCompile Include="..\wtf\win\MainThreadWin.cpp">
       <Filter>win</Filter>
     </ClCompile>
-    <ClCompile Include="..\wtf\threads\win\BinarySemaphoreWin.cpp">
-      <Filter>threads\win</Filter>
-    </ClCompile>
-    <ClCompile Include="..\wtf\threads\BinarySemaphore.cpp">
-      <Filter>threads</Filter>
-    </ClCompile>
     <ClCompile Include="..\wtf\threadspecificWin.cpp">
       <Filter>wtf</Filter>
     </ClCompile>
     <ClInclude Include="..\wtf\text\WTFString.h">
       <Filter>text</Filter>
     </ClInclude>
-    <ClInclude Include="..\wtf\threads\BinarySemaphore.h">
-      <Filter>threads</Filter>
-    </ClInclude>
     <ClInclude Include="..\wtf\threadsafeRefCounted.h">
       <Filter>wtf</Filter>
     </ClInclude>
index 3be94c7..cb3b943 100644 (file)
                A8A4744D151A825B004123FF /* ThreadingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47335151A825B004123FF /* ThreadingPrimitives.h */; };
                A8A4744E151A825B004123FF /* ThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47336151A825B004123FF /* ThreadingPthreads.cpp */; };
                A8A47450151A825B004123FF /* ThreadRestrictionVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47338151A825B004123FF /* ThreadRestrictionVerifier.h */; };
-               A8A47451151A825B004123FF /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4733A151A825B004123FF /* BinarySemaphore.cpp */; };
-               A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733B151A825B004123FF /* BinarySemaphore.h */; };
                A8A47454151A825B004123FF /* ThreadSafeRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */; };
                A8A47455151A825B004123FF /* ThreadSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733F151A825B004123FF /* ThreadSpecific.h */; };
                A8A4745E151A825B004123FF /* CharacterNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47349151A825B004123FF /* CharacterNames.h */; };
                A8A47335151A825B004123FF /* ThreadingPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadingPrimitives.h; sourceTree = "<group>"; };
                A8A47336151A825B004123FF /* ThreadingPthreads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadingPthreads.cpp; sourceTree = "<group>"; };
                A8A47338151A825B004123FF /* ThreadRestrictionVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadRestrictionVerifier.h; sourceTree = "<group>"; };
-               A8A4733A151A825B004123FF /* BinarySemaphore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinarySemaphore.cpp; sourceTree = "<group>"; };
-               A8A4733B151A825B004123FF /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = "<group>"; };
                A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadSafeRefCounted.h; sourceTree = "<group>"; };
                A8A4733F151A825B004123FF /* ThreadSpecific.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadSpecific.h; sourceTree = "<group>"; };
                A8A47349151A825B004123FF /* CharacterNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterNames.h; sourceTree = "<group>"; };
                                1FA47C87152502DA00568D1B /* ios */,
                                A8A472C4151A825A004123FF /* mac */,
                                A8A4731B151A825B004123FF /* text */,
-                               A8A47339151A825B004123FF /* threads */,
                                A8A47348151A825B004123FF /* unicode */,
                                A8A4725A151A825A004123FF /* ASCIICType.h */,
                                A8A4725B151A825A004123FF /* Assertions.cpp */,
                        path = text;
                        sourceTree = "<group>";
                };
-               A8A47339151A825B004123FF /* threads */ = {
-                       isa = PBXGroup;
-                       children = (
-                               A8A4733A151A825B004123FF /* BinarySemaphore.cpp */,
-                               A8A4733B151A825B004123FF /* BinarySemaphore.h */,
-                       );
-                       path = threads;
-                       sourceTree = "<group>";
-               };
                A8A47348151A825B004123FF /* unicode */ = {
                        isa = PBXGroup;
                        children = (
                                A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */,
                                A8A473AB151A825B004123FF /* bignum.h in Headers */,
                                7CDD7FFA186D2A54007433CD /* IteratorPair.h in Headers */,
-                               A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */,
                                A8A4738A151A825B004123FF /* Bitmap.h in Headers */,
                                A8A4738C151A825B004123FF /* BitVector.h in Headers */,
                                A8A4738E151A825B004123FF /* BlockStack.h in Headers */,
                                8134013815B092FD001FF0B8 /* Base64.cpp in Sources */,
                                A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */,
                                A8A473AA151A825B004123FF /* bignum.cc in Sources */,
-                               A8A47451151A825B004123FF /* BinarySemaphore.cpp in Sources */,
                                A8A4738B151A825B004123FF /* BitVector.cpp in Sources */,
                                A8A473AC151A825B004123FF /* cached-powers.cc in Sources */,
                                A8A47460151A825B004123FF /* CollatorDefault.cpp in Sources */,
index 3723c75..616dd5c 100644 (file)
@@ -136,8 +136,6 @@ set(WTF_HEADERS
     text/StringImpl.h
     text/WTFString.h
 
-    threads/BinarySemaphore.h
-
     unicode/CharacterNames.h
     unicode/Collator.h
     unicode/UTF8.h
@@ -203,8 +201,6 @@ set(WTF_SOURCES
     text/StringStatics.cpp
     text/WTFString.cpp
 
-    threads/BinarySemaphore.cpp
-
     unicode/UTF8.cpp
 )
 
@@ -212,7 +208,6 @@ set(WTF_INCLUDE_DIRECTORIES
     "${WTF_DIR}"
     "${WTF_DIR}/wtf"
     "${WTF_DIR}/wtf/dtoa"
-    "${WTF_DIR}/wtf/threads"
     "${WTF_DIR}/wtf/unicode"
     "${THIRDPARTY_DIR}"
     "${CMAKE_BINARY_DIR}"
index f1c223f..fa704b9 100644 (file)
@@ -38,7 +38,6 @@ template<typename T, size_t inlineCapacity, typename OverflowHandler> class Vect
 
 class AtomicString;
 class AtomicStringImpl;
-class BinarySemaphore;
 class CString;
 class Decoder;
 class Encoder;
@@ -52,7 +51,6 @@ class StringImpl;
 
 using WTF::AtomicString;
 using WTF::AtomicStringImpl;
-using WTF::BinarySemaphore;
 using WTF::CString;
 using WTF::Decoder;
 using WTF::Encoder;
index 8834d25..03668ec 100644 (file)
@@ -1,6 +1,4 @@
 list(APPEND WTF_SOURCES
-    threads/win/BinarySemaphoreWin.cpp
-
     win/MainThreadWin.cpp
     win/RunLoopWin.cpp
 )
diff --git a/Source/WTF/wtf/threads/BinarySemaphore.cpp b/Source/WTF/wtf/threads/BinarySemaphore.cpp
deleted file mode 100644 (file)
index 5f60aaf..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "BinarySemaphore.h"
-
-#if !PLATFORM(WIN)
-
-namespace WTF {
-
-BinarySemaphore::BinarySemaphore()
-    : m_isSet(false)
-{
-}
-    
-BinarySemaphore::~BinarySemaphore()
-{
-}
-
-void BinarySemaphore::signal()
-{
-    MutexLocker locker(m_mutex);
-
-    m_isSet = true;
-    m_condition.signal();
-}
-
-bool BinarySemaphore::wait(double absoluteTime)
-{
-    MutexLocker locker(m_mutex);
-
-    bool timedOut = false;
-    while (!m_isSet) {
-        timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
-        if (timedOut)
-            return false;
-    }
-
-    // Reset the semaphore.
-    m_isSet = false;
-    return true;
-}
-
-} // namespace WTF
-
-#endif // !PLATFORM(WIN)
diff --git a/Source/WTF/wtf/threads/BinarySemaphore.h b/Source/WTF/wtf/threads/BinarySemaphore.h
deleted file mode 100644 (file)
index de51d47..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef BinarySemaphore_h
-#define BinarySemaphore_h
-
-#include <wtf/Noncopyable.h>
-#include <wtf/ThreadingPrimitives.h>
-
-namespace WTF {
-
-class BinarySemaphore {
-    WTF_MAKE_NONCOPYABLE(BinarySemaphore);
-
-public:
-    WTF_EXPORT_PRIVATE BinarySemaphore();
-    WTF_EXPORT_PRIVATE ~BinarySemaphore();
-
-    WTF_EXPORT_PRIVATE void signal();
-    WTF_EXPORT_PRIVATE bool wait(double absoluteTime);
-
-#if OS(WINDOWS)
-    HANDLE event() const { return m_event; }
-#endif
-
-private:
-#if OS(WINDOWS)
-    HANDLE m_event;
-#else
-    bool m_isSet;
-
-    Mutex m_mutex;
-    ThreadCondition m_condition;
-#endif
-};
-
-} // namespace WTF
-
-using WTF::BinarySemaphore;
-
-#endif // BinarySemaphore_h
diff --git a/Source/WTF/wtf/threads/win/BinarySemaphoreWin.cpp b/Source/WTF/wtf/threads/win/BinarySemaphoreWin.cpp
deleted file mode 100644 (file)
index 0dad1ac..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "BinarySemaphore.h"
-
-namespace WTF {
-
-BinarySemaphore::BinarySemaphore()
-    : m_event(::CreateEventW(0, FALSE, FALSE, 0))
-{
-}
-
-BinarySemaphore::~BinarySemaphore()
-{
-    ::CloseHandle(m_event);
-}
-
-void BinarySemaphore::signal()
-{
-    ::SetEvent(m_event);
-}
-
-bool BinarySemaphore::wait(double absoluteTime)
-{
-    DWORD interval = absoluteTimeToWaitTimeoutInterval(absoluteTime);
-    if (!interval) {
-        // Consider the wait to have timed out, even if the event has already been signaled, to
-        // match the WTF::ThreadCondition implementation.
-        return false;
-    }
-
-    DWORD result = ::WaitForSingleObject(m_event, interval);
-    switch (result) {
-    case WAIT_OBJECT_0:
-        // The event was signaled.
-        return true;
-
-    case WAIT_TIMEOUT:
-        // The wait timed out.
-        return false;
-
-    case WAIT_FAILED:
-        ASSERT_WITH_MESSAGE(false, "::WaitForSingleObject failed with error %lu", ::GetLastError());
-        return false;
-
-    default:
-        ASSERT_WITH_MESSAGE(false, "::WaitForSingleObject returned unexpected result %lu", result);
-        return false;
-    }
-}
-
-} // namespace WTF