]> git.lyx.org Git - features.git/blobdiff - boost/boost/smart_ptr/detail/spinlock_pt.hpp
boost: add eol property
[features.git] / boost / boost / smart_ptr / detail / spinlock_pt.hpp
index f55e61f6b786aa8d7653f741f3061c11eeaf10ba..f9cabfc3a7c599b2dfedf28458ef33d4734cfd1f 100644 (file)
@@ -1,79 +1,79 @@
-#ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_PT_HPP_INCLUDED\r
-#define BOOST_SMART_PTR_DETAIL_SPINLOCK_PT_HPP_INCLUDED\r
-\r
-// MS compatible compilers support #pragma once\r
-\r
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
-# pragma once\r
-#endif\r
-\r
-//\r
-//  Copyright (c) 2008 Peter Dimov\r
-//\r
-//  Distributed under the Boost Software License, Version 1.0.\r
-//  See accompanying file LICENSE_1_0.txt or copy at\r
-//  http://www.boost.org/LICENSE_1_0.txt)\r
-//\r
-\r
-#include <pthread.h>\r
-\r
-namespace boost\r
-{\r
-\r
-namespace detail\r
-{\r
-\r
-class spinlock\r
-{\r
-public:\r
-\r
-    pthread_mutex_t v_;\r
-\r
-public:\r
-\r
-    bool try_lock()\r
-    {\r
-        return pthread_mutex_trylock( &v_ ) == 0;\r
-    }\r
-\r
-    void lock()\r
-    {\r
-        pthread_mutex_lock( &v_ );\r
-    }\r
-\r
-    void unlock()\r
-    {\r
-        pthread_mutex_unlock( &v_ );\r
-    }\r
-\r
-public:\r
-\r
-    class scoped_lock\r
-    {\r
-    private:\r
-\r
-        spinlock & sp_;\r
-\r
-        scoped_lock( scoped_lock const & );\r
-        scoped_lock & operator=( scoped_lock const & );\r
-\r
-    public:\r
-\r
-        explicit scoped_lock( spinlock & sp ): sp_( sp )\r
-        {\r
-            sp.lock();\r
-        }\r
-\r
-        ~scoped_lock()\r
-        {\r
-            sp_.unlock();\r
-        }\r
-    };\r
-};\r
-\r
-} // namespace detail\r
-} // namespace boost\r
-\r
-#define BOOST_DETAIL_SPINLOCK_INIT { PTHREAD_MUTEX_INITIALIZER }\r
-\r
-#endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_PT_HPP_INCLUDED\r
+#ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_PT_HPP_INCLUDED
+#define BOOST_SMART_PTR_DETAIL_SPINLOCK_PT_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+//  Copyright (c) 2008 Peter Dimov
+//
+//  Distributed under the Boost Software License, Version 1.0.
+//  See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <pthread.h>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class spinlock
+{
+public:
+
+    pthread_mutex_t v_;
+
+public:
+
+    bool try_lock()
+    {
+        return pthread_mutex_trylock( &v_ ) == 0;
+    }
+
+    void lock()
+    {
+        pthread_mutex_lock( &v_ );
+    }
+
+    void unlock()
+    {
+        pthread_mutex_unlock( &v_ );
+    }
+
+public:
+
+    class scoped_lock
+    {
+    private:
+
+        spinlock & sp_;
+
+        scoped_lock( scoped_lock const & );
+        scoped_lock & operator=( scoped_lock const & );
+
+    public:
+
+        explicit scoped_lock( spinlock & sp ): sp_( sp )
+        {
+            sp.lock();
+        }
+
+        ~scoped_lock()
+        {
+            sp_.unlock();
+        }
+    };
+};
+
+} // namespace detail
+} // namespace boost
+
+#define BOOST_DETAIL_SPINLOCK_INIT { PTHREAD_MUTEX_INITIALIZER }
+
+#endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_PT_HPP_INCLUDED