Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::thread::id

      From cppreference.com
      <cpp‎ |thread‎ |thread
       
       
      Concurrency support library
      Threads
      (C++11)
      (C++20)
      this_thread namespace
      (C++11)
      (C++11)
      (C++11)
      Cooperative cancellation
      Mutual exclusion
      Generic lock management
      (C++11)
      (C++11)
      (C++11)
      (C++11)
      Condition variables
      (C++11)
      Semaphores
      Latches and Barriers
      (C++20)
      (C++20)
      Futures
      (C++11)
      (C++11)
      (C++11)
      Safe reclamation
      Hazard pointers
      Atomic types
      (C++11)
      (C++20)
      Initialization of atomic types
      (C++11)(deprecated in C++20)
      (C++11)(deprecated in C++20)
      Memory ordering
      (C++11)(deprecated in C++26)
      Free functions for atomic operations
      Free functions for atomic flags
       
       
      std::thread::id
      Member functions
      Non-member functions
      (until C++20)(until C++20)(until C++20)(until C++20)(until C++20)(C++20)
      Helper classes
       
      Defined in header<thread>
      class thread::id;
      (since C++11)

      The classthread::id is a lightweight, trivially copyable class that serves as a unique identifier ofstd::threadandstd::jthread(since C++20) objects.

      Instances of this class may also hold the special distinct value that does not represent any thread. Once a thread has finished, the value ofstd::thread::id may be reused by another thread.

      This class is designed for use as key in associative containers, both ordered and unordered.

      Contents

      [edit]Member functions

      constructs an id that does not represent a thread
      (public member function)

      [edit]Non-member functions

      (removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
      compares twothread::id objects
      (function)[edit]
      serializes athread::id object
      (function template)[edit]

      [edit]Helper classes

      hash support forstd::thread::id
      (class template specialization)[edit]
      formatting support forthread::id
      (class template specialization)[edit]

      [edit]See also

      returns theid of the thread
      (public member function)[edit]
      (C++11)
      returns the thread id of the current thread
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/thread/thread/id&oldid=161282"

      [8]ページ先頭

      ©2009-2025 Movatter.jp