]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/fiber/src/numa/linux/pin_thread.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / fiber / src / numa / linux / pin_thread.cpp
index ae696be3dde7cc75d824d6a65d32ca7fad646898..730f2f5f10c4c9f36be3c14ffba1add744f57720 100644 (file)
@@ -23,11 +23,16 @@ namespace numa {
 
 BOOST_FIBERS_DECL
 void pin_thread( std::uint32_t cpuid) {
+    pin_thread( cpuid, ::pthread_self() );
+}
+
+BOOST_FIBERS_DECL
+void pin_thread( std::uint32_t cpuid, std::thread::native_handle_type h) {
     cpu_set_t set;
     CPU_ZERO( & set);
     CPU_SET( cpuid, & set);
     int err = 0;
-    if ( BOOST_UNLIKELY( 0 != ( err = ::pthread_setaffinity_np( ::pthread_self(), sizeof( set), & set) ) ) ) {
+    if ( BOOST_UNLIKELY( 0 != ( err = ::pthread_setaffinity_np( h, sizeof( set), & set) ) ) ) {
         throw std::system_error(
                 std::error_code( err, std::system_category() ),
                 "pthread_setaffinity_np() failed");