zpp
Zephyr C++20 Framework
zpp::futex Class Reference

A futex class. More...

#include <futex.hpp>

Inheritance diagram for zpp::futex:
[legend]
Collaboration diagram for zpp::futex:
[legend]

Public Member Functions

constexpr auto native_handle () noexcept -> native_pointer
 get the native zephyr futex handle. More...
 
constexpr auto native_handle () const noexcept -> native_const_pointer
 get the native zephyr futex handle. More...
 
 futex (const futex &)=delete
 
 futex (futex &&)=delete
 
futexoperator= (const futex &)=delete
 
futexoperator= (futex &&)=delete
 
- Public Member Functions inherited from zpp::futex_base< futex >
 futex_base (const futex_base &)=delete
 
 futex_base (futex_base &&)=delete
 
bool wait (int expected) noexcept
 Wait for the futex. More...
 
bool try_wait (int expected) noexcept
 Try wait for the futex. More...
 
bool try_wait_for (int expected, const std::chrono::duration< T_Rep, T_Period > &timeout) noexcept
 Wait for the futex. More...
 
void wake_one () noexcept
 Wakeup one waiting thread. More...
 
void wake_all () noexcept
 Wakeup all waiting threads. More...
 
auto native_handle () noexcept -> native_pointer
 get the native zephyr futex handle. More...
 
auto native_handle () const noexcept -> native_const_pointer
 get the native zephyr futex handle. More...
 
futex_baseoperator= (const futex_base &)=delete
 
futex_baseoperator= (futex_base &&)=delete
 

Additional Inherited Members

- Public Types inherited from zpp::futex_base< futex >
using native_type = struct k_futex
 
using native_pointer = native_type *
 
using native_const_pointer = native_type const *
 
- Protected Member Functions inherited from zpp::futex_base< futex >
constexpr futex_base () noexcept
 Default constructor. More...
 

Detailed Description

A futex class.

Definition at line 137 of file futex.hpp.

Constructor & Destructor Documentation

◆ futex() [1/2]

zpp::futex::futex ( const futex )
delete

◆ futex() [2/2]

zpp::futex::futex ( futex &&  )
delete

Member Function Documentation

◆ native_handle() [1/2]

constexpr auto zpp::futex::native_handle ( ) const -> native_const_pointer
inlineconstexprnoexcept

get the native zephyr futex handle.

Returns
A pointer to the zephyr k_futex.

Definition at line 154 of file futex.hpp.

155  {
156  return &m_futex;
157  }

◆ native_handle() [2/2]

constexpr auto zpp::futex::native_handle ( ) -> native_pointer
inlineconstexprnoexcept

get the native zephyr futex handle.

Returns
A pointer to the zephyr k_futex.

Definition at line 144 of file futex.hpp.

145  {
146  return &m_futex;
147  }

◆ operator=() [1/2]

futex& zpp::futex::operator= ( const futex )
delete

◆ operator=() [2/2]

futex& zpp::futex::operator= ( futex &&  )
delete

The documentation for this class was generated from the following file: