Loading...
Searching...
No Matches
kmp_flag_atomic< PtrType, FlagType, Sleepable > Class Template Reference

`#include <kmp_wait_release.h>`

Inheritance diagram for kmp_flag_atomic< PtrType, FlagType, Sleepable >:

## Public Member Functions

std::atomic< PtrType > * | get ()
void * | get_void_p ()
void | set (std::atomic< PtrType > *new_loc)
PtrType | load ()
void | store (PtrType val)
bool | done_check ()
bool | done_check_val (PtrType old_loc)
bool | notdone_check ()
void | internal_release ()
PtrType | set_sleeping ()
void | unset_sleeping ()
bool | is_sleeping_val (PtrType old_loc)
bool | is_sleeping ()
Public Member Functions inherited from kmp_flag< FlagType >
flag_type | get_type ()
kmp_info_t * | get_waiter (kmp_uint32 i)
kmp_uint32 | get_num_waiters ()
void | set_waiter (kmp_info_t *thr)

## Protected Attributes

std::atomic< PtrType > * | loc
PtrType | checker
Protected Attributes inherited from kmp_flag< FlagType >
flag_properties | t
kmp_info_t * | waiting_threads [1]
kmp_uint32 | num_waiting_threads

## Detailed Description

template<typename PtrType, flag_type FlagType, bool Sleepable>
class kmp_flag_atomic< PtrType, FlagType, Sleepable >

Base class for wait/release atomic flag

Definition at line 234 of file kmp_wait_release.h.

## Member Function Documentation

## done_check()

template<typename PtrType , flag_type FlagType, bool Sleepable>

bool kmp_flag_atomic< PtrType, FlagType, Sleepable >::done_check | ( |  | ) |

inline

Returns
  true if the flag object has been released.

Definition at line 261 of file kmp_wait_release.h.

## done_check_val()

template<typename PtrType , flag_type FlagType, bool Sleepable>

bool kmp_flag_atomic< PtrType, FlagType, Sleepable >::done_check_val | ( | PtrType | old_loc | ) |

inline

Parameters

  old_loc | in old value of flag

Returns
  true if the flag's old value indicates it was released.

Definition at line 269 of file kmp_wait_release.h.

## get()

template<typename PtrType , flag_type FlagType, bool Sleepable>

std::atomic< PtrType > * kmp_flag_atomic< PtrType, FlagType, Sleepable >::get | ( |  | ) |

inline

Returns
  the pointer to the actual flag

Definition at line 251 of file kmp_wait_release.h.

Referenced by kmp_flag_atomic< PtrType, FlagType, Sleepable >::internal_release(), kmp_flag_atomic< PtrType, FlagType, Sleepable >::set_sleeping(), and kmp_flag_atomic< PtrType, FlagType, Sleepable >::unset_sleeping().

## get_void_p()

template<typename PtrType , flag_type FlagType, bool Sleepable>

void * kmp_flag_atomic< PtrType, FlagType, Sleepable >::get_void_p | ( |  | ) |

inline

Returns
  void* pointer to the actual flag

Definition at line 253 of file kmp_wait_release.h.

## internal_release()

template<typename PtrType , flag_type FlagType, bool Sleepable>

void kmp_flag_atomic< PtrType, FlagType, Sleepable >::internal_release | ( |  | ) |

inline

Returns
  Actual flag value before release was applied. Trigger all waiting threads to run by modifying flag to release state.

Definition at line 278 of file kmp_wait_release.h.

## is_sleeping()

template<typename PtrType , flag_type FlagType, bool Sleepable>

bool kmp_flag_atomic< PtrType, FlagType, Sleepable >::is_sleeping | ( |  | ) |

inline

Test whether there are threads sleeping on the flag.

Definition at line 307 of file kmp_wait_release.h.

## is_sleeping_val()

template<typename PtrType , flag_type FlagType, bool Sleepable>

bool kmp_flag_atomic< PtrType, FlagType, Sleepable >::is_sleeping_val | ( | PtrType | old_loc | ) |

inline

Parameters

  old_loc | in old value of flag Test whether there are threads sleeping on flag's old value in old_loc.

Definition at line 301 of file kmp_wait_release.h.

Referenced by kmp_flag_atomic< PtrType, FlagType, Sleepable >::is_sleeping().

## load()

template<typename PtrType , flag_type FlagType, bool Sleepable>

PtrType kmp_flag_atomic< PtrType, FlagType, Sleepable >::load | ( |  | ) |

inline

Returns
  flag value

Definition at line 257 of file kmp_wait_release.h.

Referenced by kmp_flag_atomic< PtrType, FlagType, Sleepable >::done_check(), kmp_flag_atomic< PtrType, FlagType, Sleepable >::is_sleeping(), and kmp_flag_atomic< PtrType, FlagType, Sleepable >::notdone_check().

## notdone_check()

template<typename PtrType , flag_type FlagType, bool Sleepable>

bool kmp_flag_atomic< PtrType, FlagType, Sleepable >::notdone_check | ( |  | ) |

inline

Returns
  true if the flag object is not yet released. Used in __kmp_wait_template like:
  while (flag.notdone_check()) { pause(); }

Definition at line 275 of file kmp_wait_release.h.

## set()

template<typename PtrType , flag_type FlagType, bool Sleepable>

void kmp_flag_atomic< PtrType, FlagType, Sleepable >::set | ( | std::atomic< PtrType > * | new_loc | ) |

inline

Parameters

  new_loc | in set loc to point at new_loc

Definition at line 255 of file kmp_wait_release.h.

Referenced by kmp_flag_atomic< PtrType, FlagType, Sleepable >::done_check(), kmp_flag_atomic< PtrType, FlagType, Sleepable >::is_sleeping_val(), and kmp_flag_atomic< PtrType, FlagType, Sleepable >::set().

## set_sleeping()

template<typename PtrType , flag_type FlagType, bool Sleepable>

PtrType kmp_flag_atomic< PtrType, FlagType, Sleepable >::set_sleeping | ( |  | ) |

inline

Returns
  Actual flag value before sleep bit(s) set. Notes that there is at least one thread sleeping on the flag by setting sleep bit(s).

Definition at line 282 of file kmp_wait_release.h.

## store()

template<typename PtrType , flag_type FlagType, bool Sleepable>

void kmp_flag_atomic< PtrType, FlagType, Sleepable >::store | ( | PtrType | val | ) |

inline

Parameters

  val | the new flag value to be stored

Definition at line 259 of file kmp_wait_release.h.

## unset_sleeping()

template<typename PtrType , flag_type FlagType, bool Sleepable>

void kmp_flag_atomic< PtrType, FlagType, Sleepable >::unset_sleeping | ( |  | ) |

inline

Returns
  Actual flag value before sleep bit(s) cleared. Notes that there are no longer threads sleeping on the flag by clearing sleep bit(s).

Definition at line 292 of file kmp_wait_release.h.

## Member Data Documentation

## checker

template<typename PtrType , flag_type FlagType, bool Sleepable>

PtrType kmp_flag_atomic< PtrType, FlagType, Sleepable >::checker

protected

Flag == checker means it has been released.

Definition at line 237 of file kmp_wait_release.h.

Referenced by kmp_flag_atomic< PtrType, FlagType, Sleepable >::done_check(), kmp_flag_atomic< PtrType, FlagType, Sleepable >::done_check_val(), and kmp_flag_atomic< PtrType, FlagType, Sleepable >::notdone_check().

## loc

template<typename PtrType , flag_type FlagType, bool Sleepable>

std::atomic<PtrType>* kmp_flag_atomic< PtrType, FlagType, Sleepable >::loc

protected

Pointer to flag location to wait on

Definition at line 236 of file kmp_wait_release.h.

Referenced by kmp_flag_atomic< PtrType, FlagType, Sleepable >::get(), kmp_flag_atomic< PtrType, FlagType, Sleepable >::get_void_p(), kmp_flag_atomic< PtrType, FlagType, Sleepable >::load(), kmp_flag_atomic< PtrType, FlagType, Sleepable >::set(), and kmp_flag_atomic< PtrType, FlagType, Sleepable >::store().

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

- kmp_wait_release.h