]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/context/performance/bind_processor_linux.cpp
2 // Copyright Oliver Kowalke 2009.
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 "bind_processor.hpp"
17 #include <boost/config/abi_prefix.hpp>
19 void bind_to_processor( unsigned int n
)
23 CPU_SET( n
, & cpuset
);
25 int errno_( ::pthread_setaffinity_np( ::pthread_self(), sizeof( cpuset
), & cpuset
) );
27 throw std::runtime_error("::pthread_setaffinity_np() failed");
30 #include <boost/config/abi_suffix.hpp>