12 #ifndef INCLUDE_DISTORTOS_THISTHREAD_HPP_ 13 #define INCLUDE_DISTORTOS_THISTHREAD_HPP_ 22 class ThreadIdentifier;
30 #ifdef DISTORTOS_THREAD_DETACH_ENABLE 50 #endif // def DISTORTOS_THREAD_DETACH_ENABLE 60 __attribute__ ((noreturn))
128 void setPriority(uint8_t priority,
bool alwaysBehind = {});
171 template<
typename Rep,
typename Period>
172 int sleepFor(
const std::chrono::duration<Rep, Period> duration)
174 return sleepFor(std::chrono::duration_cast<TickClock::duration>(duration));
207 template<
typename Duration>
208 int sleepUntil(
const std::chrono::time_point<TickClock, Duration> timePoint)
210 return sleepUntil(std::chrono::time_point_cast<TickClock::duration>(timePoint));
227 #endif // INCLUDE_DISTORTOS_THISTHREAD_HPP_ size_t getStackSize()
Definition: ThisThread.cpp:92
void setPriority(const uint8_t priority, const bool alwaysBehind)
Definition: ThisThread.cpp:97
int sleepFor(const TickClock::duration duration)
Makes the calling (current) thread sleep for at least given duration.
Definition: ThisThread.cpp:111
int sleepUntil(const TickClock::time_point timePoint)
Makes the calling (current) thread sleep until some time point is reached.
Definition: ThisThread.cpp:116
SchedulingPolicy
scheduling policy of the thread
Definition: SchedulingPolicy.hpp:26
std::chrono::time_point< TickClock > time_point
basic time_point type of clock
Definition: TickClock.hpp:42
uint8_t getEffectivePriority()
Definition: ThisThread.cpp:58
ThreadIdentifier getIdentifier()
Definition: ThisThread.cpp:65
void yield()
Yields time slot of the scheduler to next thread.
Definition: ThisThread.cpp:124
Top-level namespace of distortos project.
Definition: buttons.hpp:33
std::chrono::duration< rep, period > duration
basic duration type of clock
Definition: TickClock.hpp:39
Thread & get()
Definition: ThisThread.cpp:51
void exit()
Exits calling (current) thread.
Definition: ThisThread.cpp:44
int detach()
Detaches calling (current) thread.
Definition: ThisThread.cpp:37
SchedulingPolicy getSchedulingPolicy()
Definition: ThisThread.cpp:80
void setSchedulingPolicy(const SchedulingPolicy schedulingPolicy)
Definition: ThisThread.cpp:104
uint8_t getPriority()
Definition: ThisThread.cpp:73
size_t getStackHighWaterMark()
Definition: ThisThread.cpp:87
SchedulingPolicy enum class header.