gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::UncontendedMutex Class Reference

#include <uncontended_mutex.hh>

Public Member Functions

 UncontendedMutex ()
 
void lock ()
 
void unlock ()
 

Private Member Functions

bool testAndSet (int expected, int desired)
 

Private Attributes

std::atomic< int > flag
 
std::mutex m
 
std::condition_variable cv
 

Detailed Description

Definition at line 47 of file uncontended_mutex.hh.

Constructor & Destructor Documentation

◆ UncontendedMutex()

gem5::UncontendedMutex::UncontendedMutex ( )
inline

Definition at line 67 of file uncontended_mutex.hh.

Member Function Documentation

◆ lock()

void gem5::UncontendedMutex::lock ( )
inline

◆ testAndSet()

bool gem5::UncontendedMutex::testAndSet ( int expected,
int desired )
inlineprivate

Definition at line 61 of file uncontended_mutex.hh.

References expected(), and flag.

Referenced by lock(), and unlock().

◆ unlock()

void gem5::UncontendedMutex::unlock ( )
inline

Member Data Documentation

◆ cv

std::condition_variable gem5::UncontendedMutex::cv
private

Definition at line 58 of file uncontended_mutex.hh.

Referenced by lock(), and unlock().

◆ flag

std::atomic<int> gem5::UncontendedMutex::flag
private

Definition at line 56 of file uncontended_mutex.hh.

Referenced by lock(), testAndSet(), and unlock().

◆ m

std::mutex gem5::UncontendedMutex::m
private

Definition at line 57 of file uncontended_mutex.hh.

Referenced by lock(), and unlock().


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

Generated on Tue Jun 18 2024 16:24:15 for gem5 by doxygen 1.11.0