Flow 1.0.2
Flow project: Full implementation reference.
sched_task_handle_state.cpp
Go to the documentation of this file.
1/* Flow
2 * Copyright 2023 Akamai Technologies, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the
5 * "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in
12 * writing, software distributed under the License is
13 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14 * CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing
16 * permissions and limitations under the License. */
17
18/// @file
19
21
22namespace flow::util
23{
24
25// Implementations.
26
28 bool single_threaded, Task_engine* task_engine,
29 Scheduled_task&& body_moved) :
30 m_id(id),
31 m_body(std::move(body_moved)),
32 m_task_engine(task_engine),
33 m_mutex_unless_single_threaded(single_threaded ? static_cast<Mutex_non_recursive*>(0) : (new Mutex_non_recursive)),
34 m_timer(*m_task_engine),
35 m_fired(false),
36 m_canceled(false)
37{
38 // Nothing else.
39}
40
41} // namespace flow::util
uint64_t id_t
Raw integer type to uniquely identify a thing. 64-bit width should make overflow extremely hard to re...
Flow module containing miscellaneous general-use facilities that don't fit into any other Flow module...
Definition: basic_blob.hpp:29
boost::mutex Mutex_non_recursive
Short-hand for non-reentrant, exclusive mutex. ("Reentrant" = one can lock an already-locked-in-that-...
Definition: util_fwd.hpp:215
boost::asio::io_service Task_engine
Short-hand for boost.asio event service, the central class of boost.asio.
Definition: util_fwd.hpp:135
Scheduled_task_handle_state(Unique_id_holder::id_t id, bool single_threaded, Task_engine *task_engine, Scheduled_task &&body_moved)
Constructs it to the initial state, wherein it has neither fired nor been canceled.