Listing 1 mutex class definition

#ifndef mutex_sem_class
#define mutex_sem_class
/*
Module Header : mutex.h
Function: Used at the top of nonreentrant functions, this limits
        access to function to one thread at a time.
*/

#define INCL_DOSSEMAPHORES
#include <os2.h>

class mutex {
   protected:
      char      *sem_name;            // name of semaphore
      HMTX      handle;               // semaphore handle
      APIRET    rc;                   // API return code

   private:
      mutex();                        // keeps user from using this

   public:
      mutex( const char const* name); // create sem_block stracture
      ~mutex();                       // auto-destructor

};
#endif
/*End of File */