SimGrid  3.16
Versatile Simulation of Distributed Systems
simgrid::simix::MutexImpl Class Reference

#include <smx_synchro_private.h>

Public Member Functions

 MutexImpl ()
 
 ~MutexImpl ()
 
 MutexImpl (MutexImpl const &)=delete
 
MutexImploperator= (MutexImpl const &)=delete
 
void lock (smx_actor_t issuer)
 
bool try_lock (smx_actor_t issuer)
 Tries to lock the mutex for a process. More...
 
void unlock (smx_actor_t issuer)
 Unlock a mutex for a process. More...
 
simgrid::s4u::Mutexmutex ()
 

Public Attributes

bool locked = false
 
smx_actor_t owner = nullptr
 
xbt_swag_t sleeping = nullptr
 

Friends

void intrusive_ptr_add_ref (MutexImpl *mutex)
 
void intrusive_ptr_release (MutexImpl *mutex)
 

Constructor & Destructor Documentation

◆ MutexImpl() [1/2]

simgrid::simix::MutexImpl::MutexImpl ( )

◆ ~MutexImpl()

simgrid::simix::MutexImpl::~MutexImpl ( )

◆ MutexImpl() [2/2]

simgrid::simix::MutexImpl::MutexImpl ( MutexImpl const &  )
delete

Member Function Documentation

◆ operator=()

MutexImpl& simgrid::simix::MutexImpl::operator= ( MutexImpl const &  )
delete

◆ lock()

void simgrid::simix::MutexImpl::lock ( smx_actor_t  issuer)

◆ try_lock()

bool simgrid::simix::MutexImpl::try_lock ( smx_actor_t  issuer)

Tries to lock the mutex for a process.

Parameters
issuerthe process that tries to acquire the mutex
Returns
whether we managed to lock the mutex

◆ unlock()

void simgrid::simix::MutexImpl::unlock ( smx_actor_t  issuer)

Unlock a mutex for a process.

Unlocks the mutex and gives it to a process waiting for it. If the unlocker is not the owner of the mutex nothing happens. If there are no process waiting, it sets the mutex as free.

◆ mutex()

simgrid::s4u::Mutex& simgrid::simix::MutexImpl::mutex ( )
inline

Friends And Related Function Documentation

◆ intrusive_ptr_add_ref

void intrusive_ptr_add_ref ( MutexImpl mutex)
friend

◆ intrusive_ptr_release

void intrusive_ptr_release ( MutexImpl mutex)
friend

Member Data Documentation

◆ locked

bool simgrid::simix::MutexImpl::locked = false

◆ owner

smx_actor_t simgrid::simix::MutexImpl::owner = nullptr

◆ sleeping

xbt_swag_t simgrid::simix::MutexImpl::sleeping = nullptr

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