Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A Mutex allows threads mutually exclusive access to a resource.
- //-----------------------------------------------------------------------
- class Mutex
- {
- private:
- CRITICAL_SECTION m_mutex;
- public:
- Mutex() { InitializeCriticalSection(&m_mutex); }
- ~Mutex() { DeleteCriticalSection(&m_mutex); }
- void acquire() { EnterCriticalSection(&m_mutex); }
- void release() { LeaveCriticalSection(&m_mutex); }
- };
- InitializeCriticalSection Error: lpCriticalSection (0x000387d4) points to an invalid
- memory location (0x00018984) Mutex::Mutex in lockmutex.h, line 29
- struct Customer {
- char * name;
- };
- extern void greetCustomer(Customer* c);
- class CheckoutLine {
- private:
- Customer m_customer;
- public CheckoutLine() {
- greetCustomer(&m_customer);
- }
- };
Add Comment
Please, Sign In to add comment