Arachne  0.1
Public Member Functions | List of all members
Arachne::SpinLock Class Reference

#include <Arachne.h>

Public Member Functions

 SpinLock (std::string name)
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 
void setName (std::string name)
 

Detailed Description

A resource that can be acquired by only one thread at a time.

Constructor & Destructor Documentation

Arachne::SpinLock::SpinLock ( std::string  name)
inlineexplicit

Constructor and destructor for spinlock.

Member Function Documentation

void Arachne::SpinLock::lock ( )
inline

Repeatedly try to acquire this resource until success.

void Arachne::SpinLock::setName ( std::string  name)
inline

Set the label used for deadlock warning.

bool Arachne::SpinLock::try_lock ( )
inline

Attempt to acquire this resource once.

Returns
Whether or not the acquisition succeeded. inline bool
void Arachne::SpinLock::unlock ( )
inline

Release resource.


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