MLIB
Loading...
Searching...
No Matches
mutex.h
Go to the documentation of this file.
1/*
2 Copyright (c) Mircea Neacsu (2014-2025) Licensed under MIT License.
3 This file is part of MLIB project. See LICENSE file for full license terms.
4*/
5
7
8#pragma once
9
10#include "syncbase.h"
11
12namespace mlib {
13
14class mutex : public syncbase
15{
16public:
17 mutex (const std::string& name = std::string ());
18 operator bool ();
19 void signal ();
20};
21
23inline void mutex::signal ()
24{
25 ReleaseMutex (handle ());
26}
27
28}; // namespace mlib
void signal()
Signal the mutex.
Definition mutex.h:23
mutex(const std::string &name=std::string())
Constructor.
Definition mutex.cpp:24
HANDLE handle() const
Return OS handle of this object.
Definition syncbase.h:53
syncbase()
Default constructor.
Definition syncbase.cpp:37
virtual const std::string & name() const
Return object's name.
Definition syncbase.h:59
Definition of mlib::syncbase class.