gem5  v21.1.0.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 Sep 21 2021 12:28:20 for gem5 by doxygen 1.8.17