gPTP Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LinuxLock Class Reference

#include <linux_hal_common.hpp>

Inheritance diagram for LinuxLock:
Inheritance graph
Collaboration diagram for LinuxLock:
Collaboration graph

Protected Member Functions

 LinuxLock ()
 
bool initialize (OSLockType type)
 Initializes all mutexes and locks. More...
 
 ~LinuxLock ()
 
OSLockResult lock ()
 Provides a simple lock mechanism. More...
 
OSLockResult trylock ()
 Provides a simple trylock mechanism. More...
 
OSLockResult unlock ()
 Provides a simple unlock mechanism. More...
 
- Protected Member Functions inherited from OSLock
 OSLock ()
 
bool initialize (OSLockType type)
 Initializes locking mechanism. More...
 

Friends

class LinuxLockFactory
 

Additional Inherited Members

Detailed Description

Extends OSLock generic interface to Linux

Constructor & Destructor Documentation

LinuxLock::LinuxLock ( )
inlineprotected

Default constructor.

LinuxLock::~LinuxLock ( )
protected

Destroys mutexes if lock is still valid

Member Function Documentation

bool LinuxLock::initialize ( OSLockType  type)
protected

Initializes all mutexes and locks.

Parameters
typeOSLockType enumeration. If oslock_recursive then set pthreads attributes to PTHREAD_MUTEX_RECURSIVE
Returns
If successful, returns oslock_ok. Returns oslock_fail otherwise
OSLockResult LinuxLock::lock ( )
protectedvirtual

Provides a simple lock mechanism.

Returns
oslock_fail if lock has failed, oslock_ok otherwise.

Implements OSLock.

OSLockResult LinuxLock::trylock ( )
protectedvirtual

Provides a simple trylock mechanism.

Returns
oslock_fail if lock has failed, oslock_ok otherwise.

Implements OSLock.

OSLockResult LinuxLock::unlock ( )
protectedvirtual

Provides a simple unlock mechanism.

Returns
oslock_fail if unlock has failed, oslock_ok otherwise.

Implements OSLock.


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