1 | 1 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,92 @@ |
1 |
+// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
+ |
|
3 |
+// Copyright Beman Dawes 1994, 2006, 2008 |
|
4 |
+// Copyright Vicente J. Botet Escriba 2009-2011 |
|
5 |
+// Copyright Christopher Brown 2013 |
|
6 |
+ |
|
7 |
+// Distributed under the Boost Software License, Version 1.0. |
|
8 |
+// See http://www.boost.org/LICENSE_1_0.txt |
|
9 |
+ |
|
10 |
+// See http://www.boost.org/libs/chrono for documentation. |
|
11 |
+ |
|
12 |
+//--------------------------------------------------------------------------------------// |
|
13 |
+ |
|
14 |
+#include <boost/chrono/config.hpp> |
|
15 |
+#include <boost/chrono/thread_clock.hpp> |
|
16 |
+#include <cassert> |
|
17 |
+#include <boost/assert.hpp> |
|
18 |
+ |
|
19 |
+# include <pthread.h> |
|
20 |
+# include <mach/thread_act.h> |
|
21 |
+ |
|
22 |
+namespace boost { namespace chrono { |
|
23 |
+ |
|
24 |
+ thread_clock::time_point thread_clock::now( ) BOOST_NOEXCEPT |
|
25 |
+ { |
|
26 |
+ // get the thread port (borrowing pthread's reference) |
|
27 |
+ mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
28 |
+ |
|
29 |
+ // get the thread info |
|
30 |
+ thread_basic_info_data_t info; |
|
31 |
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
32 |
+ if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
33 |
+ { |
|
34 |
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error"); |
|
35 |
+ return time_point(); |
|
36 |
+ } |
|
37 |
+ |
|
38 |
+ // convert to nanoseconds |
|
39 |
+ duration user = duration( |
|
40 |
+ static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
41 |
+ + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
42 |
+ |
|
43 |
+ duration system = duration( |
|
44 |
+ static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
45 |
+ + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
46 |
+ |
|
47 |
+ return time_point( user + system ); |
|
48 |
+ } |
|
49 |
+ |
|
50 |
+#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING |
|
51 |
+ thread_clock::time_point thread_clock::now( system::error_code & ec ) |
|
52 |
+ { |
|
53 |
+ // get the thread port (borrowing pthread's reference) |
|
54 |
+ mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
55 |
+ |
|
56 |
+ // get the thread info |
|
57 |
+ thread_basic_info_data_t info; |
|
58 |
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
59 |
+ if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
60 |
+ { |
|
61 |
+ if (::boost::chrono::is_throws(ec)) |
|
62 |
+ { |
|
63 |
+ boost::throw_exception( |
|
64 |
+ system::system_error( |
|
65 |
+ EINVAL, |
|
66 |
+ ::boost::system::system_category(), |
|
67 |
+ "chrono::thread_clock" )); |
|
68 |
+ } |
|
69 |
+ else |
|
70 |
+ { |
|
71 |
+ ec.assign( errno, ::boost::system::system_category() ); |
|
72 |
+ return time_point(); |
|
73 |
+ } |
|
74 |
+ } |
|
75 |
+ if (!::boost::chrono::is_throws(ec)) |
|
76 |
+ { |
|
77 |
+ ec.clear(); |
|
78 |
+ } |
|
79 |
+ |
|
80 |
+ // convert to nanoseconds |
|
81 |
+ duration user = duration( |
|
82 |
+ static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
83 |
+ + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
84 |
+ |
|
85 |
+ duration system = duration( |
|
86 |
+ static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
87 |
+ + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
88 |
+ |
|
89 |
+ return time_point( user + system ); |
|
90 |
+ } |
|
91 |
+#endif |
|
92 |
+} } |
1 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,92 +0,0 @@ |
1 |
-// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
- |
|
3 |
-// Copyright Beman Dawes 1994, 2006, 2008 |
|
4 |
-// Copyright Vicente J. Botet Escriba 2009-2011 |
|
5 |
-// Copyright Christopher Brown 2013 |
|
6 |
- |
|
7 |
-// Distributed under the Boost Software License, Version 1.0. |
|
8 |
-// See http://www.boost.org/LICENSE_1_0.txt |
|
9 |
- |
|
10 |
-// See http://www.boost.org/libs/chrono for documentation. |
|
11 |
- |
|
12 |
-//--------------------------------------------------------------------------------------// |
|
13 |
- |
|
14 |
-#include <boost/chrono/config.hpp> |
|
15 |
-#include <boost/chrono/thread_clock.hpp> |
|
16 |
-#include <cassert> |
|
17 |
-#include <boost/assert.hpp> |
|
18 |
- |
|
19 |
-# include <pthread.h> |
|
20 |
-# include <mach/thread_act.h> |
|
21 |
- |
|
22 |
-namespace boost { namespace chrono { |
|
23 |
- |
|
24 |
- thread_clock::time_point thread_clock::now( ) BOOST_NOEXCEPT |
|
25 |
- { |
|
26 |
- // get the thread port (borrowing pthread's reference) |
|
27 |
- mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
28 |
- |
|
29 |
- // get the thread info |
|
30 |
- thread_basic_info_data_t info; |
|
31 |
- mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
32 |
- if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
33 |
- { |
|
34 |
- BOOST_ASSERT(0 && "Boost::Chrono - Internal Error"); |
|
35 |
- return time_point(); |
|
36 |
- } |
|
37 |
- |
|
38 |
- // convert to nanoseconds |
|
39 |
- duration user = duration( |
|
40 |
- static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
41 |
- + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
42 |
- |
|
43 |
- duration system = duration( |
|
44 |
- static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
45 |
- + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
46 |
- |
|
47 |
- return time_point( user + system ); |
|
48 |
- } |
|
49 |
- |
|
50 |
-#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING |
|
51 |
- thread_clock::time_point thread_clock::now( system::error_code & ec ) |
|
52 |
- { |
|
53 |
- // get the thread port (borrowing pthread's reference) |
|
54 |
- mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
55 |
- |
|
56 |
- // get the thread info |
|
57 |
- thread_basic_info_data_t info; |
|
58 |
- mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
59 |
- if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
60 |
- { |
|
61 |
- if (::boost::chrono::is_throws(ec)) |
|
62 |
- { |
|
63 |
- boost::throw_exception( |
|
64 |
- system::system_error( |
|
65 |
- EINVAL, |
|
66 |
- ::boost::system::system_category(), |
|
67 |
- "chrono::thread_clock" )); |
|
68 |
- } |
|
69 |
- else |
|
70 |
- { |
|
71 |
- ec.assign( errno, ::boost::system::system_category() ); |
|
72 |
- return time_point(); |
|
73 |
- } |
|
74 |
- } |
|
75 |
- if (!::boost::chrono::is_throws(ec)) |
|
76 |
- { |
|
77 |
- ec.clear(); |
|
78 |
- } |
|
79 |
- |
|
80 |
- // convert to nanoseconds |
|
81 |
- duration user = duration( |
|
82 |
- static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
83 |
- + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
84 |
- |
|
85 |
- duration system = duration( |
|
86 |
- static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
87 |
- + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
88 |
- |
|
89 |
- return time_point( user + system ); |
|
90 |
- } |
|
91 |
-#endif |
|
92 |
-} } |
1 | 1 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,92 @@ |
1 |
+// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
+ |
|
3 |
+// Copyright Beman Dawes 1994, 2006, 2008 |
|
4 |
+// Copyright Vicente J. Botet Escriba 2009-2011 |
|
5 |
+// Copyright Christopher Brown 2013 |
|
6 |
+ |
|
7 |
+// Distributed under the Boost Software License, Version 1.0. |
|
8 |
+// See http://www.boost.org/LICENSE_1_0.txt |
|
9 |
+ |
|
10 |
+// See http://www.boost.org/libs/chrono for documentation. |
|
11 |
+ |
|
12 |
+//--------------------------------------------------------------------------------------// |
|
13 |
+ |
|
14 |
+#include <boost/chrono/config.hpp> |
|
15 |
+#include <boost/chrono/thread_clock.hpp> |
|
16 |
+#include <cassert> |
|
17 |
+#include <boost/assert.hpp> |
|
18 |
+ |
|
19 |
+# include <pthread.h> |
|
20 |
+# include <mach/thread_act.h> |
|
21 |
+ |
|
22 |
+namespace boost { namespace chrono { |
|
23 |
+ |
|
24 |
+ thread_clock::time_point thread_clock::now( ) BOOST_NOEXCEPT |
|
25 |
+ { |
|
26 |
+ // get the thread port (borrowing pthread's reference) |
|
27 |
+ mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
28 |
+ |
|
29 |
+ // get the thread info |
|
30 |
+ thread_basic_info_data_t info; |
|
31 |
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
32 |
+ if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
33 |
+ { |
|
34 |
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error"); |
|
35 |
+ return time_point(); |
|
36 |
+ } |
|
37 |
+ |
|
38 |
+ // convert to nanoseconds |
|
39 |
+ duration user = duration( |
|
40 |
+ static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
41 |
+ + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
42 |
+ |
|
43 |
+ duration system = duration( |
|
44 |
+ static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
45 |
+ + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
46 |
+ |
|
47 |
+ return time_point( user + system ); |
|
48 |
+ } |
|
49 |
+ |
|
50 |
+#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING |
|
51 |
+ thread_clock::time_point thread_clock::now( system::error_code & ec ) |
|
52 |
+ { |
|
53 |
+ // get the thread port (borrowing pthread's reference) |
|
54 |
+ mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
55 |
+ |
|
56 |
+ // get the thread info |
|
57 |
+ thread_basic_info_data_t info; |
|
58 |
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
59 |
+ if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
60 |
+ { |
|
61 |
+ if (::boost::chrono::is_throws(ec)) |
|
62 |
+ { |
|
63 |
+ boost::throw_exception( |
|
64 |
+ system::system_error( |
|
65 |
+ EINVAL, |
|
66 |
+ ::boost::system::system_category(), |
|
67 |
+ "chrono::thread_clock" )); |
|
68 |
+ } |
|
69 |
+ else |
|
70 |
+ { |
|
71 |
+ ec.assign( errno, ::boost::system::system_category() ); |
|
72 |
+ return time_point(); |
|
73 |
+ } |
|
74 |
+ } |
|
75 |
+ if (!::boost::chrono::is_throws(ec)) |
|
76 |
+ { |
|
77 |
+ ec.clear(); |
|
78 |
+ } |
|
79 |
+ |
|
80 |
+ // convert to nanoseconds |
|
81 |
+ duration user = duration( |
|
82 |
+ static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
83 |
+ + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
84 |
+ |
|
85 |
+ duration system = duration( |
|
86 |
+ static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
87 |
+ + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
88 |
+ |
|
89 |
+ return time_point( user + system ); |
|
90 |
+ } |
|
91 |
+#endif |
|
92 |
+} } |
From: Steffen Neumann <sneumann@ipb-halle.de>
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@125184 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,15 +0,0 @@ |
1 |
-// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
- |
|
3 |
-// Copyright Vicente J. Botet Escriba 2010 |
|
4 |
- |
|
5 |
-// Distributed under the Boost Software License, Version 1.0. |
|
6 |
-// See http://www.boost.org/LICENSE_1_0.txt |
|
7 |
- |
|
8 |
-// See http://www.boost.org/libs/chrono for documentation. |
|
9 |
- |
|
10 |
-//--------------------------------------------------------------------------------------// |
|
11 |
- |
|
12 |
-#include <boost/chrono/config.hpp> |
|
13 |
-#include <boost/chrono/detail/inlined/posix/thread_clock.hpp> |
|
14 |
-#include <cassert> |
|
15 |
- |
From: Laurent <lg390@cam.ac.uk>
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@125180 bc3139a8-67e5-0310-9ffc-ced21a209358
... | ... |
@@ -1,91 +1,15 @@ |
1 |
-// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
- |
|
3 |
-// Copyright Beman Dawes 1994, 2006, 2008 |
|
4 |
-// Copyright Vicente J. Botet Escriba 2009-2011 |
|
5 |
-// Copyright Christopher Brown 2013 |
|
6 |
- |
|
7 |
-// Distributed under the Boost Software License, Version 1.0. |
|
8 |
-// See http://www.boost.org/LICENSE_1_0.txt |
|
9 |
- |
|
10 |
-// See http://www.boost.org/libs/chrono for documentation. |
|
11 |
- |
|
12 |
-//--------------------------------------------------------------------------------------// |
|
13 |
- |
|
14 |
-#include <boost/chrono/config.hpp> |
|
15 |
-#include <boost/chrono/thread_clock.hpp> |
|
16 |
-#include <cassert> |
|
17 |
- |
|
18 |
-# include <pthread.h> |
|
19 |
-# include <mach/thread_act.h> |
|
20 |
- |
|
21 |
-namespace boost { namespace chrono { |
|
22 |
- |
|
23 |
- thread_clock::time_point thread_clock::now( ) BOOST_NOEXCEPT |
|
24 |
- { |
|
25 |
- // get the thread port (borrowing pthread's reference) |
|
26 |
- mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
27 |
- |
|
28 |
- // get the thread info |
|
29 |
- thread_basic_info_data_t info; |
|
30 |
- mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
31 |
- if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
32 |
- { |
|
33 |
- BOOST_ASSERT(0 && "Boost::Chrono - Internal Error"); |
|
34 |
- return time_point(); |
|
35 |
- } |
|
36 |
- |
|
37 |
- // convert to nanoseconds |
|
38 |
- duration user = duration( |
|
39 |
- static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
40 |
- + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
41 |
- |
|
42 |
- duration system = duration( |
|
43 |
- static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
44 |
- + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
45 |
- |
|
46 |
- return time_point( user + system ); |
|
47 |
- } |
|
48 |
- |
|
49 |
-#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING |
|
50 |
- thread_clock::time_point thread_clock::now( system::error_code & ec ) |
|
51 |
- { |
|
52 |
- // get the thread port (borrowing pthread's reference) |
|
53 |
- mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
54 |
- |
|
55 |
- // get the thread info |
|
56 |
- thread_basic_info_data_t info; |
|
57 |
- mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
58 |
- if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
59 |
- { |
|
60 |
- if (BOOST_CHRONO_IS_THROWS(ec)) |
|
61 |
- { |
|
62 |
- boost::throw_exception( |
|
63 |
- system::system_error( |
|
64 |
- EINVAL, |
|
65 |
- BOOST_CHRONO_SYSTEM_CATEGORY, |
|
66 |
- "chrono::thread_clock" )); |
|
67 |
- } |
|
68 |
- else |
|
69 |
- { |
|
70 |
- ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY ); |
|
71 |
- return time_point(); |
|
72 |
- } |
|
73 |
- } |
|
74 |
- if (!BOOST_CHRONO_IS_THROWS(ec)) |
|
75 |
- { |
|
76 |
- ec.clear(); |
|
77 |
- } |
|
78 |
- |
|
79 |
- // convert to nanoseconds |
|
80 |
- duration user = duration( |
|
81 |
- static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
82 |
- + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
83 |
- |
|
84 |
- duration system = duration( |
|
85 |
- static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
86 |
- + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
87 |
- |
|
88 |
- return time_point( user + system ); |
|
89 |
- } |
|
90 |
-#endif |
|
91 |
-} } |
|
1 |
+// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
+ |
|
3 |
+// Copyright Vicente J. Botet Escriba 2010 |
|
4 |
+ |
|
5 |
+// Distributed under the Boost Software License, Version 1.0. |
|
6 |
+// See http://www.boost.org/LICENSE_1_0.txt |
|
7 |
+ |
|
8 |
+// See http://www.boost.org/libs/chrono for documentation. |
|
9 |
+ |
|
10 |
+//--------------------------------------------------------------------------------------// |
|
11 |
+ |
|
12 |
+#include <boost/chrono/config.hpp> |
|
13 |
+#include <boost/chrono/detail/inlined/posix/thread_clock.hpp> |
|
14 |
+#include <cassert> |
|
15 |
+ |
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
... | ... |
@@ -1,15 +1,91 @@ |
1 |
-// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
- |
|
3 |
-// Copyright Vicente J. Botet Escriba 2010 |
|
4 |
- |
|
5 |
-// Distributed under the Boost Software License, Version 1.0. |
|
6 |
-// See http://www.boost.org/LICENSE_1_0.txt |
|
7 |
- |
|
8 |
-// See http://www.boost.org/libs/chrono for documentation. |
|
9 |
- |
|
10 |
-//--------------------------------------------------------------------------------------// |
|
11 |
- |
|
12 |
-#include <boost/chrono/config.hpp> |
|
13 |
-#include <boost/chrono/detail/inlined/posix/thread_clock.hpp> |
|
14 |
-#include <cassert> |
|
15 |
- |
|
1 |
+// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
+ |
|
3 |
+// Copyright Beman Dawes 1994, 2006, 2008 |
|
4 |
+// Copyright Vicente J. Botet Escriba 2009-2011 |
|
5 |
+// Copyright Christopher Brown 2013 |
|
6 |
+ |
|
7 |
+// Distributed under the Boost Software License, Version 1.0. |
|
8 |
+// See http://www.boost.org/LICENSE_1_0.txt |
|
9 |
+ |
|
10 |
+// See http://www.boost.org/libs/chrono for documentation. |
|
11 |
+ |
|
12 |
+//--------------------------------------------------------------------------------------// |
|
13 |
+ |
|
14 |
+#include <boost/chrono/config.hpp> |
|
15 |
+#include <boost/chrono/thread_clock.hpp> |
|
16 |
+#include <cassert> |
|
17 |
+ |
|
18 |
+# include <pthread.h> |
|
19 |
+# include <mach/thread_act.h> |
|
20 |
+ |
|
21 |
+namespace boost { namespace chrono { |
|
22 |
+ |
|
23 |
+ thread_clock::time_point thread_clock::now( ) BOOST_NOEXCEPT |
|
24 |
+ { |
|
25 |
+ // get the thread port (borrowing pthread's reference) |
|
26 |
+ mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
27 |
+ |
|
28 |
+ // get the thread info |
|
29 |
+ thread_basic_info_data_t info; |
|
30 |
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
31 |
+ if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
32 |
+ { |
|
33 |
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error"); |
|
34 |
+ return time_point(); |
|
35 |
+ } |
|
36 |
+ |
|
37 |
+ // convert to nanoseconds |
|
38 |
+ duration user = duration( |
|
39 |
+ static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
40 |
+ + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
41 |
+ |
|
42 |
+ duration system = duration( |
|
43 |
+ static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
44 |
+ + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
45 |
+ |
|
46 |
+ return time_point( user + system ); |
|
47 |
+ } |
|
48 |
+ |
|
49 |
+#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING |
|
50 |
+ thread_clock::time_point thread_clock::now( system::error_code & ec ) |
|
51 |
+ { |
|
52 |
+ // get the thread port (borrowing pthread's reference) |
|
53 |
+ mach_port_t port = pthread_mach_thread_np(pthread_self()); |
|
54 |
+ |
|
55 |
+ // get the thread info |
|
56 |
+ thread_basic_info_data_t info; |
|
57 |
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
|
58 |
+ if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS ) |
|
59 |
+ { |
|
60 |
+ if (BOOST_CHRONO_IS_THROWS(ec)) |
|
61 |
+ { |
|
62 |
+ boost::throw_exception( |
|
63 |
+ system::system_error( |
|
64 |
+ EINVAL, |
|
65 |
+ BOOST_CHRONO_SYSTEM_CATEGORY, |
|
66 |
+ "chrono::thread_clock" )); |
|
67 |
+ } |
|
68 |
+ else |
|
69 |
+ { |
|
70 |
+ ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY ); |
|
71 |
+ return time_point(); |
|
72 |
+ } |
|
73 |
+ } |
|
74 |
+ if (!BOOST_CHRONO_IS_THROWS(ec)) |
|
75 |
+ { |
|
76 |
+ ec.clear(); |
|
77 |
+ } |
|
78 |
+ |
|
79 |
+ // convert to nanoseconds |
|
80 |
+ duration user = duration( |
|
81 |
+ static_cast<thread_clock::rep>( info.user_time.seconds ) * 1000000000 |
|
82 |
+ + static_cast<thread_clock::rep>(info.user_time.microseconds ) * 1000); |
|
83 |
+ |
|
84 |
+ duration system = duration( |
|
85 |
+ static_cast<thread_clock::rep>( info.system_time.seconds ) * 1000000000 |
|
86 |
+ + static_cast<thread_clock::rep>( info.system_time.microseconds ) * 1000); |
|
87 |
+ |
|
88 |
+ return time_point( user + system ); |
|
89 |
+ } |
|
90 |
+#endif |
|
91 |
+} } |
git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR@90759 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,15 @@ |
1 |
+// boost thread_clock.cpp -----------------------------------------------------------// |
|
2 |
+ |
|
3 |
+// Copyright Vicente J. Botet Escriba 2010 |
|
4 |
+ |
|
5 |
+// Distributed under the Boost Software License, Version 1.0. |
|
6 |
+// See http://www.boost.org/LICENSE_1_0.txt |
|
7 |
+ |
|
8 |
+// See http://www.boost.org/libs/chrono for documentation. |
|
9 |
+ |
|
10 |
+//--------------------------------------------------------------------------------------// |
|
11 |
+ |
|
12 |
+#include <boost/chrono/config.hpp> |
|
13 |
+#include <boost/chrono/detail/inlined/posix/thread_clock.hpp> |
|
14 |
+#include <cassert> |
|
15 |
+ |