summaryrefslogtreecommitdiff
path: root/boost/asio/detail/impl/posix_thread.ipp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 06:11:01 (GMT)
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 06:11:01 (GMT)
commit3fdc3e5ee96dca5b11d1694975a65200787eab86 (patch)
tree5c1733853892b8397d67706fa453a9bd978d2102 /boost/asio/detail/impl/posix_thread.ipp
parent88e602c57797660ebe0f9e15dbd64c1ff16dead3 (diff)
downloadboost-3fdc3e5ee96dca5b11d1694975a65200787eab86.zip
boost-3fdc3e5ee96dca5b11d1694975a65200787eab86.tar.gz
boost-3fdc3e5ee96dca5b11d1694975a65200787eab86.tar.bz2
Imported Upstream version 1.66.0upstream/1.66.0
Diffstat (limited to 'boost/asio/detail/impl/posix_thread.ipp')
-rw-r--r--boost/asio/detail/impl/posix_thread.ipp10
1 files changed, 10 insertions, 0 deletions
diff --git a/boost/asio/detail/impl/posix_thread.ipp b/boost/asio/detail/impl/posix_thread.ipp
index 66cb18d..66a6792 100644
--- a/boost/asio/detail/impl/posix_thread.ipp
+++ b/boost/asio/detail/impl/posix_thread.ipp
@@ -44,6 +44,16 @@ void posix_thread::join()
}
}
+std::size_t posix_thread::hardware_concurrency()
+{
+#if defined(_SC_NPROCESSORS_ONLN)
+ long result = sysconf(_SC_NPROCESSORS_ONLN);
+ if (result > 0)
+ return result;
+#endif // defined(_SC_NPROCESSORS_ONLN)
+ return 0;
+}
+
void posix_thread::start_thread(func_base* arg)
{
int error = ::pthread_create(&thread_, 0,