November 01, 1995
Multithreading in C++
November 1995/Multithreading in C++/Listing 1
#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