FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
November 01, 1995

Multithreading in C++

(Page 2 of 6)
November 1995/Multithreading in C++/Listing 1

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 */
Previous Page | 1 | 2 | 3 | 4 | 5 | 6 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK