/* $Id: MutexRep.h,v 1.6 1999/09/09 15:50:22 v2kea318 Exp $

$Log: MutexRep.h,v $
 * Revision 1.6  1999/09/09  15:50:22  v2kea318
 * Use thread-safe version of the Pointer class.
 *
 * Revision 1.5  1999/09/07  17:01:47  v2kea318
 * Use the Mutex::new_mutex factory method to build the correct type of
 * Mutex.
 *
 * Revision 1.4  1999/08/17  14:46:47  v2kea318
 * Moved all method implementations to a separate file.
 *
 * Revision 1.3  1999/08/17  14:41:27  v2kea318
 * Rewrote the explanatory comments.
 *
 * Revision 1.2  1999/08/17  14:37:27  v2kea318
 * Remove the grab method.  The mutex is automatically grabbed by the
 * copy constructor and assignment operator.  Now all the user need be
 * concerned with is obtaining a copy of the initial object; the rest is
 * done automatically.
 *
 * Revision 1.1  1999/08/16  21:51:19  v2kea318
 * Initial revision
 *
***************************************************************************

Create a class that will wrap a Mutex object and provide for automatic
management of the mutex resource.  If a instance is created, then any
copy of that instance will have the mutex locked.  When that copy is
destroyed, the mutex will automatically be released.  This makes
mutex management very simple for a client.

***************************************************************************/

#ifndef MUTEX_REP_H
#define MUTEX_REP_H

#include "Mutex.h"
#include "pointer.h"

class MutexRep {
public:
    MutexRep() : mut(Mutex::new_mutex(), true) {}
    MutexRep(const MutexRep& mrep);
    ~MutexRep() ;
    MutexRep& operator = (const MutexRep& r);
private:
    Pointer<Mutex> mut;
};

#endif
