Browse code

Adding IPC detail on windows

Steffen Neumann authored on 18/01/2022 08:33:38
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,99 @@
1
+//////////////////////////////////////////////////////////////////////////////
2
+//
3
+// (C) Copyright Ion Gaztanaga 2012-2013. Distributed under the Boost
4
+// Software License, Version 1.0. (See accompanying file
5
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
+//
7
+// See http://www.boost.org/libs/interprocess for documentation.
8
+//
9
+//////////////////////////////////////////////////////////////////////////////
10
+
11
+#ifndef BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
12
+#define BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
13
+
14
+#ifndef BOOST_CONFIG_HPP
15
+#  include <boost/config.hpp>
16
+#endif
17
+#
18
+#if defined(BOOST_HAS_PRAGMA_ONCE)
19
+#  pragma once
20
+#endif
21
+
22
+#include <boost/interprocess/detail/config_begin.hpp>
23
+#include <boost/interprocess/detail/workaround.hpp>
24
+
25
+#include <boost/interprocess/sync/spin/wait.hpp>
26
+
27
+namespace boost {
28
+namespace interprocess {
29
+namespace ipcdetail {
30
+
31
+template<class MutexType>
32
+bool try_based_timed_lock(MutexType &m, const boost::posix_time::ptime &abs_time)
33
+{
34
+   //Same as lock()
35
+   if(abs_time.is_pos_infinity()){
36
+      m.lock();
37
+      return true;
38
+   }
39
+   //Always try to lock to achieve POSIX guarantees:
40
+   // "Under no circumstance shall the function fail with a timeout if the mutex
41
+   //  can be locked immediately. The validity of the abs_timeout parameter need not
42
+   //  be checked if the mutex can be locked immediately."
43
+   else if(m.try_lock()){
44
+      return true;
45
+   }
46
+   else{
47
+      spin_wait swait;
48
+      while(microsec_clock::universal_time() < abs_time){
49
+         if(m.try_lock()){
50
+            return true;
51
+         }
52
+         swait.yield();
53
+      }
54
+      return false;
55
+   }
56
+}
57
+
58
+template<class MutexType>
59
+void try_based_lock(MutexType &m)
60
+{
61
+   if(!m.try_lock()){
62
+      spin_wait swait;
63
+      do{
64
+         if(m.try_lock()){
65
+            break;
66
+         }
67
+         else{
68
+            swait.yield();
69
+         }
70
+      }
71
+      while(1);
72
+   }
73
+}
74
+
75
+template<class MutexType>
76
+void timeout_when_locking_aware_lock(MutexType &m)
77
+{
78
+   #ifdef BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING
79
+      boost::posix_time::ptime wait_time
80
+         = microsec_clock::universal_time()
81
+         + boost::posix_time::milliseconds(BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS);
82
+      if (!m.timed_lock(wait_time))
83
+      {
84
+         throw interprocess_exception(timeout_when_locking_error
85
+                                     , "Interprocess mutex timeout when locking. Possible deadlock: "
86
+                                       "owner died without unlocking?");
87
+      }
88
+   #else
89
+      m.lock();
90
+   #endif
91
+}
92
+
93
+}  //namespace ipcdetail
94
+}  //namespace interprocess
95
+}  //namespace boost
96
+
97
+#include <boost/interprocess/detail/config_end.hpp>
98
+
99
+#endif   //BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
Browse code

remove (hopefully) unused directories

Steffen Neumann authored on 23/09/2021 15:21:20
Showing 1 changed files
1 1
deleted file mode 100755
... ...
@@ -1,99 +0,0 @@
1
-//////////////////////////////////////////////////////////////////////////////
2
-//
3
-// (C) Copyright Ion Gaztanaga 2012-2013. Distributed under the Boost
4
-// Software License, Version 1.0. (See accompanying file
5
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
-//
7
-// See http://www.boost.org/libs/interprocess for documentation.
8
-//
9
-//////////////////////////////////////////////////////////////////////////////
10
-
11
-#ifndef BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
12
-#define BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
13
-
14
-#ifndef BOOST_CONFIG_HPP
15
-#  include <boost/config.hpp>
16
-#endif
17
-#
18
-#if defined(BOOST_HAS_PRAGMA_ONCE)
19
-#  pragma once
20
-#endif
21
-
22
-#include <boost/interprocess/detail/config_begin.hpp>
23
-#include <boost/interprocess/detail/workaround.hpp>
24
-
25
-#include <boost/interprocess/sync/spin/wait.hpp>
26
-
27
-namespace boost {
28
-namespace interprocess {
29
-namespace ipcdetail {
30
-
31
-template<class MutexType>
32
-bool try_based_timed_lock(MutexType &m, const boost::posix_time::ptime &abs_time)
33
-{
34
-   //Same as lock()
35
-   if(abs_time.is_pos_infinity()){
36
-      m.lock();
37
-      return true;
38
-   }
39
-   //Always try to lock to achieve POSIX guarantees:
40
-   // "Under no circumstance shall the function fail with a timeout if the mutex
41
-   //  can be locked immediately. The validity of the abs_timeout parameter need not
42
-   //  be checked if the mutex can be locked immediately."
43
-   else if(m.try_lock()){
44
-      return true;
45
-   }
46
-   else{
47
-      spin_wait swait;
48
-      while(microsec_clock::universal_time() < abs_time){
49
-         if(m.try_lock()){
50
-            return true;
51
-         }
52
-         swait.yield();
53
-      }
54
-      return false;
55
-   }
56
-}
57
-
58
-template<class MutexType>
59
-void try_based_lock(MutexType &m)
60
-{
61
-   if(!m.try_lock()){
62
-      spin_wait swait;
63
-      do{
64
-         if(m.try_lock()){
65
-            break;
66
-         }
67
-         else{
68
-            swait.yield();
69
-         }
70
-      }
71
-      while(1);
72
-   }
73
-}
74
-
75
-template<class MutexType>
76
-void timeout_when_locking_aware_lock(MutexType &m)
77
-{
78
-   #ifdef BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING
79
-      boost::posix_time::ptime wait_time
80
-         = microsec_clock::universal_time()
81
-         + boost::posix_time::milliseconds(BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS);
82
-      if (!m.timed_lock(wait_time))
83
-      {
84
-         throw interprocess_exception(timeout_when_locking_error
85
-                                     , "Interprocess mutex timeout when locking. Possible deadlock: "
86
-                                       "owner died without unlocking?");
87
-      }
88
-   #else
89
-      m.lock();
90
-   #endif
91
-}
92
-
93
-}  //namespace ipcdetail
94
-}  //namespace interprocess
95
-}  //namespace boost
96
-
97
-#include <boost/interprocess/detail/config_end.hpp>
98
-
99
-#endif   //BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
Browse code

Updating pwiz to 3_0_21263

Steffen Neumann authored on 23/09/2021 12:34:25
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,99 @@
1
+//////////////////////////////////////////////////////////////////////////////
2
+//
3
+// (C) Copyright Ion Gaztanaga 2012-2013. Distributed under the Boost
4
+// Software License, Version 1.0. (See accompanying file
5
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
+//
7
+// See http://www.boost.org/libs/interprocess for documentation.
8
+//
9
+//////////////////////////////////////////////////////////////////////////////
10
+
11
+#ifndef BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
12
+#define BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
13
+
14
+#ifndef BOOST_CONFIG_HPP
15
+#  include <boost/config.hpp>
16
+#endif
17
+#
18
+#if defined(BOOST_HAS_PRAGMA_ONCE)
19
+#  pragma once
20
+#endif
21
+
22
+#include <boost/interprocess/detail/config_begin.hpp>
23
+#include <boost/interprocess/detail/workaround.hpp>
24
+
25
+#include <boost/interprocess/sync/spin/wait.hpp>
26
+
27
+namespace boost {
28
+namespace interprocess {
29
+namespace ipcdetail {
30
+
31
+template<class MutexType>
32
+bool try_based_timed_lock(MutexType &m, const boost::posix_time::ptime &abs_time)
33
+{
34
+   //Same as lock()
35
+   if(abs_time.is_pos_infinity()){
36
+      m.lock();
37
+      return true;
38
+   }
39
+   //Always try to lock to achieve POSIX guarantees:
40
+   // "Under no circumstance shall the function fail with a timeout if the mutex
41
+   //  can be locked immediately. The validity of the abs_timeout parameter need not
42
+   //  be checked if the mutex can be locked immediately."
43
+   else if(m.try_lock()){
44
+      return true;
45
+   }
46
+   else{
47
+      spin_wait swait;
48
+      while(microsec_clock::universal_time() < abs_time){
49
+         if(m.try_lock()){
50
+            return true;
51
+         }
52
+         swait.yield();
53
+      }
54
+      return false;
55
+   }
56
+}
57
+
58
+template<class MutexType>
59
+void try_based_lock(MutexType &m)
60
+{
61
+   if(!m.try_lock()){
62
+      spin_wait swait;
63
+      do{
64
+         if(m.try_lock()){
65
+            break;
66
+         }
67
+         else{
68
+            swait.yield();
69
+         }
70
+      }
71
+      while(1);
72
+   }
73
+}
74
+
75
+template<class MutexType>
76
+void timeout_when_locking_aware_lock(MutexType &m)
77
+{
78
+   #ifdef BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING
79
+      boost::posix_time::ptime wait_time
80
+         = microsec_clock::universal_time()
81
+         + boost::posix_time::milliseconds(BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS);
82
+      if (!m.timed_lock(wait_time))
83
+      {
84
+         throw interprocess_exception(timeout_when_locking_error
85
+                                     , "Interprocess mutex timeout when locking. Possible deadlock: "
86
+                                       "owner died without unlocking?");
87
+      }
88
+   #else
89
+      m.lock();
90
+   #endif
91
+}
92
+
93
+}  //namespace ipcdetail
94
+}  //namespace interprocess
95
+}  //namespace boost
96
+
97
+#include <boost/interprocess/detail/config_end.hpp>
98
+
99
+#endif   //BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
Browse code

checkout latest pwiz, ammend Makevars

From: Laurent <lg390@cam.ac.uk>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@125180 bc3139a8-67e5-0310-9ffc-ced21a209358

l.gatto authored on 15/12/2016 10:21:41
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,81 +0,0 @@
1
-//////////////////////////////////////////////////////////////////////////////
2
-//
3
-// (C) Copyright Ion Gaztanaga 2012-2013. Distributed under the Boost
4
-// Software License, Version 1.0. (See accompanying file
5
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
-//
7
-// See http://www.boost.org/libs/interprocess for documentation.
8
-//
9
-//////////////////////////////////////////////////////////////////////////////
10
-
11
-#ifndef BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
12
-#define BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
13
-
14
-#ifndef BOOST_CONFIG_HPP
15
-#  include <boost/config.hpp>
16
-#endif
17
-#
18
-#if defined(BOOST_HAS_PRAGMA_ONCE)
19
-#  pragma once
20
-#endif
21
-
22
-#include <boost/interprocess/detail/config_begin.hpp>
23
-#include <boost/interprocess/detail/workaround.hpp>
24
-
25
-#include <boost/interprocess/sync/spin/wait.hpp>
26
-
27
-namespace boost {
28
-namespace interprocess {
29
-namespace ipcdetail {
30
-
31
-template<class MutexType>
32
-bool try_based_timed_lock(MutexType &m, const boost::posix_time::ptime &abs_time)
33
-{
34
-   //Same as lock()
35
-   if(abs_time == boost::posix_time::pos_infin){
36
-      m.lock();
37
-      return true;
38
-   }
39
-   //Always try to lock to achieve POSIX guarantees:
40
-   // "Under no circumstance shall the function fail with a timeout if the mutex
41
-   //  can be locked immediately. The validity of the abs_timeout parameter need not
42
-   //  be checked if the mutex can be locked immediately."
43
-   else if(m.try_lock()){
44
-      return true;
45
-   }
46
-   else{
47
-      spin_wait swait;
48
-      while(microsec_clock::universal_time() < abs_time){
49
-         if(m.try_lock()){
50
-            return true;
51
-         }
52
-         swait.yield();
53
-      }
54
-      return false;
55
-   }
56
-}
57
-
58
-template<class MutexType>
59
-void try_based_lock(MutexType &m)
60
-{
61
-   if(!m.try_lock()){
62
-      spin_wait swait;
63
-      do{
64
-         if(m.try_lock()){
65
-            break;
66
-         }
67
-         else{
68
-            swait.yield();
69
-         }
70
-      }
71
-      while(1);
72
-   }
73
-}
74
-
75
-}  //namespace ipcdetail
76
-}  //namespace interprocess
77
-}  //namespace boost
78
-
79
-#include <boost/interprocess/detail/config_end.hpp>
80
-
81
-#endif   //BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
Browse code

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 0b3d4d9bb71e3ca5891b777610fc8dec103a6d61

Bumped version after KK's updates


Commit id: 9e04409b64757a177893d56c0300904f31945cb1

modified: src/pwiz/data/common/BinaryIndexStream.cpp modified: src/win/i386/libpwiz.a modified: src/win/x64/libpwiz.a


Commit id: f16b04258dc20bf3315beac99708e11728cfc12b

update precompiled lib for windows


Commit id: 5d56197f1148378d92e89b2d0a167e18c4b7ab2e

Bump version, tame .Rbuildignore


Commit id: 432da5bd294c9b87f7761e15bc814c3785c21abf

Merge remote-tracking branch 'origin/boost_159'


Commit id: 92be978bf72d90c2222a19ddf365f6d1acc9f20d

upadte Makevars


Commit id: ae75037a780cead56c4d20bedf822c94fb413677

upgrade to boost 1.5.9



git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@110126 bc3139a8-67e5-0310-9ffc-ced21a209358

s.neumann authored on 01/11/2015 22:33:47
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,81 @@
1
+//////////////////////////////////////////////////////////////////////////////
2
+//
3
+// (C) Copyright Ion Gaztanaga 2012-2013. Distributed under the Boost
4
+// Software License, Version 1.0. (See accompanying file
5
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
+//
7
+// See http://www.boost.org/libs/interprocess for documentation.
8
+//
9
+//////////////////////////////////////////////////////////////////////////////
10
+
11
+#ifndef BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
12
+#define BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP
13
+
14
+#ifndef BOOST_CONFIG_HPP
15
+#  include <boost/config.hpp>
16
+#endif
17
+#
18
+#if defined(BOOST_HAS_PRAGMA_ONCE)
19
+#  pragma once
20
+#endif
21
+
22
+#include <boost/interprocess/detail/config_begin.hpp>
23
+#include <boost/interprocess/detail/workaround.hpp>
24
+
25
+#include <boost/interprocess/sync/spin/wait.hpp>
26
+
27
+namespace boost {
28
+namespace interprocess {
29
+namespace ipcdetail {
30
+
31
+template<class MutexType>
32
+bool try_based_timed_lock(MutexType &m, const boost::posix_time::ptime &abs_time)
33
+{
34
+   //Same as lock()
35
+   if(abs_time == boost::posix_time::pos_infin){
36
+      m.lock();
37
+      return true;
38
+   }
39
+   //Always try to lock to achieve POSIX guarantees:
40
+   // "Under no circumstance shall the function fail with a timeout if the mutex
41
+   //  can be locked immediately. The validity of the abs_timeout parameter need not
42
+   //  be checked if the mutex can be locked immediately."
43
+   else if(m.try_lock()){
44
+      return true;
45
+   }
46
+   else{
47
+      spin_wait swait;
48
+      while(microsec_clock::universal_time() < abs_time){
49
+         if(m.try_lock()){
50
+            return true;
51
+         }
52
+         swait.yield();
53
+      }
54
+      return false;
55
+   }
56
+}
57
+
58
+template<class MutexType>
59
+void try_based_lock(MutexType &m)
60
+{
61
+   if(!m.try_lock()){
62
+      spin_wait swait;
63
+      do{
64
+         if(m.try_lock()){
65
+            break;
66
+         }
67
+         else{
68
+            swait.yield();
69
+         }
70
+      }
71
+      while(1);
72
+   }
73
+}
74
+
75
+}  //namespace ipcdetail
76
+}  //namespace interprocess
77
+}  //namespace boost
78
+
79
+#include <boost/interprocess/detail/config_end.hpp>
80
+
81
+#endif   //BOOST_INTERPROCESS_SYNC_DETAIL_COMMON_ALGORITHMS_HPP