Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# Copyright (c) The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or http://www.opensource.org/licenses/mit-license.php.5# Define HAVE_PTHREAD_* variables depending on what pthread functions are6# available.8include(CMakePushCheckState)9include(CheckCXXSourceCompiles)11cmake_push_check_state()12set(CMAKE_REQUIRED_LIBRARIES Threads::Threads)13check_cxx_source_compiles("14#include <pthread.h>15int main(int argc, char** argv)16{17char thread_name[16];18return pthread_getname_np(pthread_self(), thread_name, sizeof(thread_name));19}"20HAVE_PTHREAD_GETNAME_NP)22check_cxx_source_compiles("23#include <cstdint>24#include <pthread.h>25int main(int argc, char** argv)26{27uint64_t tid;28pthread_threadid_np(nullptr, &tid);29return 0;30}"31HAVE_PTHREAD_THREADID_NP)33check_cxx_source_compiles("34#include <pthread.h>35#include <pthread_np.h>36int main(int argc, char** argv)37{38return pthread_getthreadid_np();39}"40HAVE_PTHREAD_GETTHREADID_NP)41cmake_pop_check_state()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.