Itzam/C++

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


itzam::simple_mutex Class Reference

A simple mutual exclusion lock. More...

#include <itzam_common.h>

Inheritance diagram for itzam::simple_mutex:

itzam::mutex List of all members.

Public Member Functions


Detailed Description

This lock is a simple boolean flag, using the SUSv2 function usleep to implement a yield for other processes.


Constructor & Destructor Documentation

itzam::simple_mutex::simple_mutex  )  [inline]
 

Creates a new simple_mutex, with the lock set to false.

virtual itzam::simple_mutex::~simple_mutex  )  [inline, virtual]
 

Does nothing.


Member Function Documentation

virtual void itzam::simple_mutex::lock  )  [inline, virtual]
 

Attempts to lock a database resource. If the resource is already locked, this function should block, calling sleep() and then attempting to lock the resource again.

Implements itzam::mutex.

virtual void itzam::simple_mutex::sleep  )  [inline, virtual]
 

This function calls the SUSv2 version of usleep() to enable other processes to run while the calling process is waiting for a resource to be released.

Implements itzam::mutex.

virtual void itzam::simple_mutex::unlock  )  [inline, virtual]
 

Unlock a database resource, allowing other processes access.

Implements itzam::mutex.


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

© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.