MipBaselib::EnhancedMutEx Class Reference

Provides to another resource class, enanched MutEx capability. More...

#include <Thread.h>

List of all members.

Public Member Functions

 EnhancedMutEx ()
 Default constructor.
bool askExclusiveAccess (Time timeout)
 Aks to use the resources.
void leaveExclusiveAccess ()
 Release the resource.
bool allowed (void)
 Says if the thread is allowed to use the resource or not.
string print ()
 Print.


Detailed Description

Provides to another resource class, enanched MutEx capability.

Author:
Antonio Franchi
Note:
It does not allow to effectively use a method of the resource class without a locking, and allow to use more than a method of the resource class without interrupts.

For example see the toys example below.

It does NOT work with shared memory among processes.

Examples:

exampleThread.cpp.


Constructor & Destructor Documentation

MipBaselib::EnhancedMutEx::EnhancedMutEx (  ) 

Default constructor.


Member Function Documentation

bool MipBaselib::EnhancedMutEx::askExclusiveAccess ( Time  timeout  ) 

Aks to use the resources.

Returns:
true if the resource can be used, false otherwise.
Note:
If it returns true it must be called a leaveExclusiveAccess() when read/write is completed.

void MipBaselib::EnhancedMutEx::leaveExclusiveAccess (  ) 

Release the resource.

Note:

bool MipBaselib::EnhancedMutEx::allowed ( void   )  [inline]

Says if the thread is allowed to use the resource or not.

Note:
Prompt a warning.

It must be called at the begin of every method of the MutExed resource.

string MipBaselib::EnhancedMutEx::print (  ) 

Print.


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

Generated on Mon Feb 20 07:01:12 2017 for MIP by  doxygen 1.5.6