mySemaphore copy 2 - void unlock(); public: p...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#ifndef mySemaphore_H #define mySemaphore_H # #define OPEN 0 #define CREATE 1 # /* #define _MSC_VER 6000 #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 */ #define _WIN32_WINNT 0x0400 # #include <windows.h> #include <winuser.h> #include <winbase.h> #include <string> using namespace std; u class mySemaphore { public: p long initialCount=0,long maxCount=1, int accessMode=CREATE,BOOL canInherit=TRUE); i virtual ~mySemaphore(); public: p void closeSemaphore(); BOOL lock(BOOL wait=TRUE);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: void unlock(); public: p string&amp; getSemaphoreName() { return semaphoreName; } long getInitialCount() { return initCount; } long getMaxCount() { return maxCount; } BOOL getInerit() { return inherit; } B private: p void getErrorDetail(int&amp;,string&amp;); v private: p long initCount; // initialCount long maxCount; // max count BOOL inherit; // can be inherited by child string semaphoreName; HANDLE semaphore; LPSECURITY_ATTRIBUTES sa; }; #endif...
View Full Document

This note was uploaded on 03/27/2011 for the course COMPUTER 101 taught by Professor Bobthebuilder during the Spring '11 term at Columbia College.

Ask a homework question - tutors are online