70 explicit mutex(
bool initially_owned);
75 explicit mutex(
const string& name);
81 mutex(
const string& name,
bool& created_new);
86 mutex(
bool initially_owned,
const string& name);
92 mutex(
bool initially_owned,
const string& name,
bool& created_new);
96 template<
class char_t>
117 int32 compare_to(const
mutex& value) const noexcept override;
119 bool equals(const
object& obj) const noexcept override;
197 void create(
bool initially_owned,
bool& created_new);
Represents an instant in time, typically expressed as a date and time of day.
Definition date_time.hpp:85
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
A synchronization primitive that can also be used for interprocess synchronization.
Definition mutex.hpp:50
void release_mutex()
Releases the Mutex once.
static mutex open_existing(const string &name)
Opens an existing named mutex.
mutex(const string &name, bool &created_new)
Initializes a new instance of the xtd::threading::mutex class with a string that is the name of the m...
bool try_lock_until(const date_time &timeout_time) noexcept
Tries to lock the mutex. Blocks until specified timeout_time has been reached or the lock is acquired...
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
mutex(bool initially_owned, const string &name)
Initializes a new instance of the xtd::threading::mutex class with a bool value that indicates whethe...
void lock()
Locks the mutex. If another thread has already locked the mutex, a call to lock will block execution ...
intptr native_handle_type
Rpresents the native handle type.
Definition mutex.hpp:59
mutex(bool initially_owned)
Initializes a new instance of the xtd::threading::mutex with a bool value that indicates whether the ...
bool signal() override
Releases ownership of the specified wait_handle object.
intptr handle() const noexcept override
Gets the native operating system handle.
mutex()
Initializes a new instance of the xtd::threading::mutex class with default properties.
void close() override
Releases all resources held by the current xtd::threading::wait_handle.
mutex(const string &name)
Initializes a new instance of the xtd::threading::mutex class with a string that is the name of the m...
void unlock()
Unlocks the mutex.
mutex(bool initially_owned, const string &name, bool &created_new)
Initializes a new instance of the xtd::threading::mutex class with a bool value that indicates whethe...
bool wait(int32 milliseconds_timeout) override
wait ownership of the specified mutex object.
native_handle_type native_handle() const noexcept
Returns the underlying implementation-defined native handle object.
bool try_lock() noexcept
Tries to lock the mutex. Returns immediately. On successful lock acquisition returns true,...
bool try_lock_for(const time_span &timeout) noexcept
Tries to lock the mutex. Blocks until specified timeout_duration has elapsed or the lock is acquired,...
static bool try_open_existing(const string &name, mutex &result) noexcept
Opens the specified named mutex, if it already exists, and returns a value that indicates whether the...
Creates and controls a thread, sets its priority, and gets its status.
Definition thread.hpp:45
Contains a constant used to specify an infinite amount of time. This class cannot be inherited.
Definition timeout.hpp:33
wait_handle()=default
Initializes a new instance of the xtd::threading::wait_handle class.
Represents a time interval.
Definition time_span.hpp:29
Contains xtd::date_time class.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
Contains xtd::icomparable interface.
Contains xtd::iequatable interface.
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::threading::wait_handle class.