Pigweed
C/C++ API Reference
Home
Modules
Loading...
Searching...
No Matches
thread_notification.h
1
// Copyright 2021 The Pigweed Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4
// use this file except in compliance with the License. You may obtain a copy of
5
// the License at
6
//
7
// https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
// License for the specific language governing permissions and limitations under
13
// the License.
14
#pragma once
15
16
#include "pw_sync_backend/thread_notification_native.h"
17
18
namespace
pw::sync
{
19
21
38
class
ThreadNotification
{
39
public
:
40
using
native_handle_type = backend::NativeThreadNotificationHandle;
41
42
ThreadNotification
();
43
~ThreadNotification
();
44
ThreadNotification
(
const
ThreadNotification
&) =
delete
;
45
ThreadNotification
(
ThreadNotification
&&) =
delete
;
46
ThreadNotification
& operator=(
const
ThreadNotification
&) =
delete
;
47
ThreadNotification
& operator=(
ThreadNotification
&&) =
delete
;
48
55
void
acquire
();
56
66
[[nodiscard]]
bool
try_acquire
();
67
77
void
release
();
78
79
[[nodiscard]] native_handle_type native_handle();
80
81
private
:
83
backend::NativeThreadNotification native_type_;
84
};
85
87
88
}
// namespace pw::sync
89
90
#include "pw_sync_backend/thread_notification_inline.h"
pw::sync::ThreadNotification
Definition:
thread_notification.h:38
pw::sync::ThreadNotification::try_acquire
bool try_acquire()
pw::sync::ThreadNotification::acquire
void acquire()
pw::sync::ThreadNotification::release
void release()
pw::sync
Definition:
binary_semaphore.h:26
pw_sync
public
pw_sync
thread_notification.h
Generated by
1.9.6