Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
select.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/select.h at
4// fcccb8cb6e1e67d7ba0822ac14cece9ee4c7091b.
5
6#ifndef THREAD_FIBER_SELECT_H_
7#define THREAD_FIBER_SELECT_H_
8
9#include "thread/cases.h"
10
11namespace thread {
12
13// Returns a selected case index or -1 on expiry. A ready case wins over an
14// already-expired deadline. The deadline is accepted as wall time and then
15// measured by the verified monotonic clock.
16int SelectUntil(absl::Time deadline, const CaseArray& cases);
17
18inline int Select(const CaseArray& cases) {
19 return SelectUntil(absl::InfiniteFuture(), cases);
20}
21
22} // namespace thread
23
24#endif // THREAD_FIBER_SELECT_H_
Definition channel.h:29
absl::InlinedVector< Case, 4 > CaseArray
Definition cases.h:98
int SelectUntil(absl::Time deadline, const CaseArray &cases)
Returns the index of the first case that is ready, or -1 if the deadline has expired without any case...
Definition select.cc:55
int Select(const CaseArray &cases)
Returns the index of the first case that is ready, blocking until one is.
Definition select.h:18