gem5  v21.2.1.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sc_core::sc_mutex Class Reference

#include <sc_mutex.hh>

Inheritance diagram for sc_core::sc_mutex:
sc_core::sc_mutex_if sc_core::sc_object sc_core::sc_interface

Public Member Functions

 sc_mutex ()
 
 sc_mutex (const char *name)
 
virtual int lock ()
 
virtual int trylock ()
 
virtual int unlock ()
 
virtual const char * kind () const
 
- Public Member Functions inherited from sc_core::sc_interface
virtual void register_port (sc_port_base &, const char *)
 
virtual const sc_eventdefault_event () const
 
virtual ~sc_interface ()
 
- Public Member Functions inherited from sc_core::sc_object
const char * name () const
 
const char * basename () const
 
virtual void print (std::ostream &=std::cout) const
 
virtual void dump (std::ostream &=std::cout) const
 
virtual const std::vector< sc_object * > & get_child_objects () const
 
virtual const std::vector< sc_event * > & get_child_events () const
 
sc_objectget_parent_object () const
 
bool add_attribute (sc_attr_base &)
 
sc_attr_baseget_attribute (const std::string &)
 
sc_attr_baseremove_attribute (const std::string &)
 
void remove_all_attributes ()
 
int num_attributes () const
 
sc_attr_cltnattr_cltn ()
 
const sc_attr_cltnattr_cltn () const
 
sc_simcontextsimcontext () const
 

Private Member Functions

 sc_mutex (const sc_mutex &)
 
sc_mutexoperator= (const sc_mutex &)
 

Private Attributes

sc_process_handle holder
 
sc_gem5::InternalScEvent unlockEvent
 

Additional Inherited Members

- Protected Member Functions inherited from sc_core::sc_mutex_if
 sc_mutex_if ()
 
- Protected Member Functions inherited from sc_core::sc_interface
 sc_interface ()
 
- Protected Member Functions inherited from sc_core::sc_object
 sc_object ()
 
 sc_object (const char *)
 
 sc_object (const sc_object &)
 
sc_objectoperator= (const sc_object &)
 
virtual ~sc_object ()
 

Detailed Description

Definition at line 39 of file sc_mutex.hh.

Constructor & Destructor Documentation

◆ sc_mutex() [1/3]

sc_core::sc_mutex::sc_mutex ( )

Definition at line 35 of file sc_mutex.cc.

◆ sc_mutex() [2/3]

sc_core::sc_mutex::sc_mutex ( const char *  name)
explicit

Definition at line 39 of file sc_mutex.cc.

◆ sc_mutex() [3/3]

sc_core::sc_mutex::sc_mutex ( const sc_mutex )
inlineprivate

Definition at line 53 of file sc_mutex.hh.

Member Function Documentation

◆ kind()

virtual const char* sc_core::sc_mutex::kind ( ) const
inlinevirtual

Reimplemented from sc_core::sc_object.

Definition at line 49 of file sc_mutex.hh.

◆ lock()

int sc_core::sc_mutex::lock ( )
virtual

Implements sc_core::sc_mutex_if.

Definition at line 44 of file sc_mutex.cc.

References trylock(), unlockEvent, and sc_core::wait().

◆ operator=()

sc_mutex& sc_core::sc_mutex::operator= ( const sc_mutex )
inlineprivate

Definition at line 54 of file sc_mutex.hh.

◆ trylock()

int sc_core::sc_mutex::trylock ( )
virtual

◆ unlock()

int sc_core::sc_mutex::unlock ( )
virtual

Implements sc_core::sc_mutex_if.

Definition at line 61 of file sc_mutex.cc.

References holder, sc_core::sc_event::notify(), sc_gem5::scheduler, and unlockEvent.

Member Data Documentation

◆ holder

sc_process_handle sc_core::sc_mutex::holder
private

Definition at line 56 of file sc_mutex.hh.

Referenced by trylock(), and unlock().

◆ unlockEvent

sc_gem5::InternalScEvent sc_core::sc_mutex::unlockEvent
private

Definition at line 57 of file sc_mutex.hh.

Referenced by lock(), and unlock().


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

Generated on Wed May 4 2022 12:16:38 for gem5 by doxygen 1.8.17