]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fiber/src/numa/aix/pin_thread.cpp
2 // Copyright Oliver Kowalke 2017.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 #include "boost/fiber/numa/pin_thread.hpp"
10 #include <sys/errno.h>
11 #include <sys/processor.h>
12 #include <sys/thread.h>
15 #include <system_error>
17 #ifdef BOOST_HAS_ABI_HEADERS
18 # include BOOST_ABI_PREFIX
26 void pin_thread( std::uint32_t cpuid
) {
27 if ( BOOST_UNLIKELY( -1 == ::bindprocessor( BINDTHREAD
, ::thread_self(), static_cast< cpu_t
>( cpuid
) ) ) ) {
28 throw std::system_error(
29 std::error_code( errno
, std::system_category() ),
30 "bindprocessor() failed");
36 #ifdef BOOST_HAS_ABI_HEADERS
37 # include BOOST_ABI_SUFFIX