xtd 0.2.0
Loading...
Searching...
No Matches
critical_section.h
Go to the documentation of this file.
1
4#pragma once
6#if !defined(__XTD_CORE_NATIVE_LIBRARY__)
7#error "Do not include this file: Internal use only"
8#endif
10
11#include <xtd/core_native_export>
12#include <cstddef>
13#include <cstdint>
14#include <string>
15
17namespace xtd {
19 namespace threading {
20 class monitor;
21 }
23
26 namespace native {
35 class core_native_export_ critical_section final {
36 critical_section() = delete;
38 protected:
40
45 static intmax_t create();
46
50 static void destroy(intmax_t handle);
51
55 static void enter(intmax_t handle);
56
60 static bool try_enter(intmax_t handle);
61
65 static void leave(intmax_t handle);
67 };
68 }
69}
Contains critical_section native API.
Definition critical_section.h:35
static bool try_enter(intmax_t handle)
Attempts to enter critical section with specified critical section handle.
static void leave(intmax_t handle)
Release`critical section with specified critical section handle.
static intmax_t create()
Create critical section.
static void destroy(intmax_t handle)
Destroy critical section with specified critical section handle.
static void enter(intmax_t handle)
Wait critical section with specified critical section handle.
Provides a mechanism that synchronizes access to objects.
Definition monitor.h:130
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10