Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
selectables.h
Go to the documentation of this file.
1// Copyright 2026 The Action Engine Authors and the Symbian SDK Authors.
2// Licensed under the Apache License, Version 2.0.
3// Adapted from A11 cpp/thread/thread/selectables.h at
4// fcccb8cb6e1e67d7ba0822ac14cece9ee4c7091b.
5
6#ifndef THREAD_FIBER_SELECTABLES_H_
7#define THREAD_FIBER_SELECTABLES_H_
8
9#include <atomic>
10
11#include <absl/base/nullability.h>
12
13#include "thread/cases.h"
14
15namespace thread {
16
17class PermanentEvent final : public internal::Selectable {
18 public:
19 PermanentEvent() = default;
22 ~PermanentEvent() override;
23
24 void Notify();
25 bool HasBeenNotified() const;
26
27 Case OnEvent() const { return {const_cast<PermanentEvent*>(this)}; }
28
29 bool Handle(internal::CaseInSelectClause* absl_nonnull case_state,
30 bool enqueue) override;
31 void Unregister(
32 internal::CaseInSelectClause* absl_nonnull case_state) override;
33
34 private:
35 mutable Mutex mu_;
36 std::atomic<bool> notified_{false};
37 internal::CaseInSelectClause* absl_nullable cases_to_be_selected_ = nullptr;
38};
39
42
43} // namespace thread
44
45#endif // THREAD_FIBER_SELECTABLES_H_
Definition boost_primitives.h:36
Definition selectables.h:17
PermanentEvent & operator=(const PermanentEvent &)=delete
bool HasBeenNotified() const
Definition selectables.cc:68
PermanentEvent(const PermanentEvent &)=delete
void Notify()
Definition selectables.cc:44
bool Handle(internal::CaseInSelectClause *absl_nonnull case_state, bool enqueue) override
Definition selectables.cc:23
~PermanentEvent() override
Definition selectables.cc:16
Case OnEvent() const
Definition selectables.h:27
void Unregister(internal::CaseInSelectClause *absl_nonnull case_state) override
Definition selectables.cc:36
Definition channel.h:29
Case NonSelectableCase()
Definition selectables.cc:97
Case AlwaysSelectableCase()
Definition selectables.cc:101
A Case represents a selectable case in a Select statement.
Definition cases.h:57