std::this_thread(3cxx)

Hey bestie πŸ’– you've landed on std::this_thread(3cxx), the libstdc++ manual page for the ISO C++ 2011 namespace that handles interacting with the current thread. Yes, the current thread β€” main character energy only. ✨

πŸ’– NAME πŸ’–

std::this_thread β€” ISO C++ 2011 namespace for interacting with the current thread.

✨ SYNOPSIS ✨

🧚 Functions 🧚

Here's the whole squad, no cap:

  • thread::id get_id () noexcept β€” The unique identifier of the current thread.
  • template<typename _Rep , typename _Period > void sleep_for (const chrono::duration< _Rep, _Period > &__rtime) β€” this_thread::sleep_for
  • template<typename _Clock , typename _Duration > void sleep_until (const chrono::time_point< _Clock, _Duration > &__atime) β€” this_thread::sleep_until
  • void yield () noexcept β€” Allow the implementation to schedule a different thread.

🌈 Detailed Description 🌈

std::this_thread is the ISO C++ 2011 namespace for interacting with the current thread. That's the whole vibe: current thread, current moment, current you. πŸ’…

Standards receipt, bestie: C++11 30.3.2 [thread.thread.this] Namespace this_thread.

πŸ‘‘ Function Documentation πŸ‘‘

πŸ¦‹ get_id

thread::id std::this_thread::get_id () [inline],  [noexcept]

The unique identifier of the current thread. Iconic. ✨

πŸ¦‹ sleep_for

template<typename _Rep , typename _Period > void std::this_thread::sleep_for (const chrono::duration< _Rep, _Period > & __rtime) [inline]

this_thread::sleep_for

Referenced by sleep_until().

πŸ¦‹ sleep_until

template<typename _Clock , typename _Duration > void std::this_thread::sleep_until (const chrono::time_point< _Clock, _Duration > & __atime) [inline]

this_thread::sleep_until

References sleep_for().

πŸ¦‹ yield

void std::this_thread::yield () [inline],  [noexcept]

Allow the implementation to schedule a different thread.

πŸŽ€ Author πŸŽ€

Generated automatically by Doxygen for libstdc++ from the source code.


Source/version: libstdc++. Footer tag: std::this_thread(3cxx). Date: the original footer doesn't list one, so I'm not inventing it, bestie β€” periodt. 🫢

πŸ“¦ where this page comes from