CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
mutex.h
1
2#pragma once
3#include "system/object.h"
4#include "system/threading/wait_handle.h"
5
6namespace System { namespace Threading {
7class MutexHandler;
8
65class ASPOSECPP_SHARED_CLASS Mutex : public WaitHandle
66{
68 RTTI_INFO(System::Threading::Mutex, ::System::BaseTypesInfo<System::Threading::WaitHandle>);
69
70public:
72 ASPOSECPP_SHARED_API Mutex();
75 ASPOSECPP_SHARED_API Mutex(bool initiallyOwned);
79 ASPOSECPP_SHARED_API Mutex(bool initiallyOwned, const String& name);
80
82 ASPOSECPP_SHARED_API void ReleaseMutex();
83
85 virtual ASPOSECPP_SHARED_API bool Reset();
87 virtual ASPOSECPP_SHARED_API bool Set();
88
91 virtual ASPOSECPP_SHARED_API bool WaitOne() override;
95 virtual ASPOSECPP_SHARED_API bool WaitOne(int millisecondsTimeout) override;
99 virtual ASPOSECPP_SHARED_API bool WaitOne(TimeSpan timeout) override;
100
103 static ASPOSECPP_SHARED_API bool Remove(const String& mutexName);
104
105private:
107 std::unique_ptr<MutexHandler> m_mutex_handler;
108
112 static std::unique_ptr<MutexHandler> CreateMutexHandler(bool initiallyOwned, const String& name);
113};
114
115}} // namespace System{ namespace Threading{
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Mutex implemnetation. Objects of this class should only be allocated using System::MakeObject() funct...
Definition: mutex.h:66
virtual bool Set()
Set mutex to signalled state. Not implemented.
static bool Remove(const String &mutexName)
Erases a named mutex from the system.
virtual bool Reset()
Resets mutex state. Not implemented.
void ReleaseMutex()
Releases the mutex.
Mutex(bool initiallyOwned, const String &name)
Constructor.
virtual bool WaitOne(int millisecondsTimeout) override
Locks mutex. Performs waiting if neccessary.
Mutex()
Constructs unowned mutex.
virtual bool WaitOne(TimeSpan timeout) override
Locks mutex. Performs waiting if neccessary.
Mutex(bool initiallyOwned)
Constructor.
virtual bool WaitOne() override
Locks mutex. Performs unlimited waiting if neccessary.
Waiting primitive base class. Objects of this class should only be allocated using System::MakeObject...
Definition: wait_handle.h:20
Represents a time interval. This type should be allocated on stack and passed to functions by value o...
Definition: timespan.h:59
Definition: db_command.h:9