C++11 thread drop in replacement.
More...
C++11 thread drop in replacement.
- See also
- std::thread, std::this_thread
- Author
- Raphael Hiesgen <raphael.hiesgen (at) haw-hamburg.de>
- Deprecated
- The C++ compat threading API has several API flaws, such as use of dynamic memory management, unconfigurable stack sizes, and runtime crashes on memory fragmentation. It also has not been maintained since 2015. Users should use the C API such as thread_create instead. This functionality will be dropped after the 2027.04 release.
Definition in file thread.hpp.
#include "time.h"
#include "thread.h"
#include <array>
#include <tuple>
#include <atomic>
#include <memory>
#include <utility>
#include <exception>
#include <stdexcept>
#include <functional>
#include <type_traits>
#include "riot/mutex.hpp"
#include "riot/chrono.hpp"
#include "riot/condition_variable.hpp"
#include "riot/detail/thread_util.hpp"
Go to the source code of this file.
|
| namespace | riot |
| | RIOT C++ namespace.
|
| |
◆ get_id()
| thread_id riot::this_thread::get_id |
( |
| ) |
|
|
inlinenoexcept |
Access the id of the currently running thread.
Definition at line 164 of file thread.hpp.
◆ sleep_for() [1/2]
template<class Rep, class Period>
| void riot::this_thread::sleep_for |
( |
const std::chrono::duration< Rep, Period > & | sleep_duration | ) |
|
Puts the current thread to sleep.
- Parameters
-
| [in] | sleep_duration | The duration to sleep. |
Definition at line 179 of file thread.hpp.
◆ sleep_for() [2/2]
| void riot::this_thread::sleep_for |
( |
const std::chrono::microseconds & | us | ) |
|
Puts the current thread to sleep.
- Parameters
-
| [in] | us | Duration to sleep in microseconds. |
◆ sleep_until()
Puts the current thread to sleep.
- Parameters
-
| [in] | sleep_time | A point in time that specifies when the thread should wake up. |
Definition at line 204 of file thread.hpp.
◆ yield()
| void riot::this_thread::yield |
( |
| ) |
|
|
inlinenoexcept |
Yield the currently running thread.
Definition at line 168 of file thread.hpp.