c3484735 | 04-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Add static to method
This function isn't used outside of this compile unit, and has no definition in a header. Declare it static.
Change-Id: Ibebbaec1926cf03380fb5dff063eccef061ad809 Signed-off-by
Add static to method
This function isn't used outside of this compile unit, and has no definition in a header. Declare it static.
Change-Id: Ibebbaec1926cf03380fb5dff063eccef061ad809 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
b8be599f | 04-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Remove extra semi-colons
A couple functions had extra semi-colons, which clang -Weverything flags. Remove them.
Change-Id: I2b44444c3184817dd0035c62b5ae114254457398 Signed-off-by: Ed Tanous <edtan
Remove extra semi-colons
A couple functions had extra semi-colons, which clang -Weverything flags. Remove them.
Change-Id: I2b44444c3184817dd0035c62b5ae114254457398 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
115e9b3d | 23-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: allow many exceptions
Allow many spawned tasks to throw exceptions and queue them up, re-throwing them one-by-one from `context::run` calls. Similarly enhance `context::scope` so th
async: context: allow many exceptions
Allow many spawned tasks to throw exceptions and queue them up, re-throwing them one-by-one from `context::run` calls. Similarly enhance `context::scope` so that many `context::empty` completions can complete with error.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I8744e0a3b8b0663ebd5ca26db0f5943688afe62a
show more ...
|
10483c94 | 23-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: allow run re-entrance
Switch the context call so that it can be re-entrant. A single call to `run` will either:
1. Process until the context is successfully stopped. 2. An
async: context: allow run re-entrance
Switch the context call so that it can be re-entrant. A single call to `run` will either:
1. Process until the context is successfully stopped. 2. An exception is raised from a spawned task.
If an exception is raised, it could be caught outside the run call and then run called again.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Icd05df421a1f0592bd2390fbe8e21a16252eafed
show more ...
|
3c242ba4 | 23-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: simplify run function
Since we already have a `spawn` function to add async tasks, get rid of the special "startup" task send to run. Instead users should pass the start up work to
async: context: simplify run function
Since we already have a `spawn` function to add async tasks, get rid of the special "startup" task send to run. Instead users should pass the start up work to spawn and call run with no parameters.
Eventually this will allow us to exit the run-loop for any and all exceptions from the async context and potentially allow a caller to re-enter the `run` loop after handling the child exception.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia0e09a2493f0554538315d1d0c238aa11cb44e39
show more ...
|
095eff81 | 22-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: scope: allow blocks before started
In some cases it may be helpful to be able to block on a scope before work has begun on that scope. Add state tracking to know when the scope has first sta
async: scope: allow blocks before started
In some cases it may be helpful to be able to block on a scope before work has begun on that scope. Add state tracking to know when the scope has first started.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9ee48aa19344b80124aa9409a4a7e368eb025882
show more ...
|
4cfc284d | 22-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: handle exceptions and stops
Add support in `context` and `scope` to handle exceptions and stop conditions:
* When an unhandled_stop occurs, turn it into an UnhandledStop exception. *
async: handle exceptions and stops
Add support in `context` and `scope` to handle exceptions and stop conditions:
* When an unhandled_stop occurs, turn it into an UnhandledStop exception. * When a `scope`-spawned task throws an exception, save it and cause `set_error` on the `scope::empty()`'s Receiver. * When anything in the `context` completes with `set_error` propagate that out to the caller of `context::run`. * If multiple exceptions occur within a `scope`, terminate.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I25285f7ece5c0675864489bbe1345fa8e7afa70c
show more ...
|
1b7b54ca | 21-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: match: stop pending sender on dtor
If the match is destructed with a pending Sender completion, we need to 'stop' that Sender. We cannot 'complete' the Sender because we do not have a messag
async: match: stop pending sender on dtor
If the match is destructed with a pending Sender completion, we need to 'stop' that Sender. We cannot 'complete' the Sender because we do not have a message (dbus signal) associated with the match, but if we do nothing then the Sender is hung (and leaked).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia6e465d46f0f7da08a385cf7c875bbda88a5ab61
show more ...
|
78e436fe | 21-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: handle shutdown better
When the context has been requested to stop we don't actually want to stop it until all work has completed. Work that is pending could require the dbus/event
async: context: handle shutdown better
When the context has been requested to stop we don't actually want to stop it until all work has completed. Work that is pending could require the dbus/event to function properly so we need to keep that running until that time. If we shutdown those too early, we can end up with a spawned task which never completes because it is relying on an event which is never processed.
In order to keep all of these straight, split the scope/stop_tokens into two: pending and internal. Pending tasks are for those 'spawned' due to the user requests and internal tasks are those maintained by the context itself to aid in processing. Defer shutting down the dbus/event handlers until all 'pending' work is completed.
Add a test-case which use to hang and now completes.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I399d065ae15b24ad3971c526c27b73757af14b34
show more ...
|
c5b5ff57 | 21-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: scope: add completion sender
Add a mechanism to await the completion of an async::scope, equivalent to a 'join' on the spawned tasks it contains.
Signed-off-by: Patrick Williams <patrick@stw
async: scope: add completion sender
Add a mechanism to await the completion of an async::scope, equivalent to a 'join' on the spawned tasks it contains.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I669680441704cdb59aa982d97bed610178c498b9
show more ...
|
0139cac7 | 20-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: add scope
In order to be able to create multiple subtasks as a collection and in order to make sure we keep good track of any tasks that are created by the context, add a `scope` as a contain
async: add scope
In order to be able to create multiple subtasks as a collection and in order to make sure we keep good track of any tasks that are created by the context, add a `scope` as a container of subtasks. This is partially modelled after the C++ P2519 proposal.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6e99b2fa2829d80c320491991f7e038f122963a9
show more ...
|
435eb1bd | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: add sleep_for sender
Sometimes it is useful to do the equivalent of `std::this_thread::sleep_for` in a co-routine context. Add a sender-based implementation to async.
Signed-off-by: Patrick
async: add sleep_for sender
Sometimes it is useful to do the equivalent of `std::this_thread::sleep_for` in a co-routine context. Add a sender-based implementation to async.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9991eb40b7a1b12e61511f1200bc99fdcdbccf0a
show more ...
|
3ce3159b | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
event: add oneshot timer support
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9785fa52e38202821258ad162e6f9168c71e53f7 |
73e278b5 | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: support stopping the context
Up until this point, the async::context would run forever and have no way of exiting the process, which isn't very useful. Add some support for stop con
async: context: support stopping the context
Up until this point, the async::context would run forever and have no way of exiting the process, which isn't very useful. Add some support for stop conditions so that we can ask the context to stop and cleanly exit.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia5967162fb103d4b4b0490d8cbbef12bdb361bac
show more ...
|
d2b00440 | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
event: add a simple wrapper around sd-event
In order to facilitate stop-conditions on the async::context, we need to be able to escape the wait on the dbus fd. sd-event will allow us to do this and
event: add a simple wrapper around sd-event
In order to facilitate stop-conditions on the async::context, we need to be able to escape the wait on the dbus fd. sd-event will allow us to do this and also build other co-routine primitives in the future (such as `co_await async::delay(1s)` backed by sd-event timers). Define a simple wrapper around sd-event here which can be leveraged by the async framework.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I945416cbce3c98d98135c42cb7ca249a57cb9a60
show more ...
|
290fa427 | 29-Aug-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: add match
Define a class which will register for a dbus signal match and generate Senders that await new signals.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib1d77708d74e
async: add match
Define a class which will register for a dbus signal match and generate Senders that await new signals.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib1d77708d74e6063bcaa08fc76fb98667ee7a2cb
show more ...
|
74187667 | 26-Aug-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: add context support
In order to handle async operations, we need some kind of 'run-loop' around the sd_bus_wait/sd_bus_process process. Define a 'context' to hold the bus and manage the run-l
async: add context support
In order to handle async operations, we need some kind of 'run-loop' around the sd_bus_wait/sd_bus_process process. Define a 'context' to hold the bus and manage the run-loop.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I16099dd2e15809776827dd85327d950af3f8f5b2
show more ...
|
41f42f6b | 30-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update with latest
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I19356ecda2940a32661f54c0b54c74acc891f9c4 |
f289c65f | 26-Aug-2022 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update with latest
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I461b17ee197528f125239f3cb8678dca45eaa634 |
c8447d52 | 05-Jan-2022 |
Krzysztof Grobelny <krzysztof.grobelny@intel.com> |
added support for optionals in unpackProperties
- Added support for optionals - Added support for pointers - Removed support for moving data from input container - Removed support for container type
added support for optionals in unpackProperties
- Added support for optionals - Added support for pointers - Removed support for moving data from input container - Removed support for container types other than std::vector
Tested: - Unit tests are passing - Examples which use unpackProperties are working correctly
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com> Change-Id: I3dbd7333237a1373d784187951ad6abe217567d1
show more ...
|
66492215 | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
bus: reduce forward declaration for friendship
Generally we do not want users to be able to get the underlying `sd_bus` pointer held by the `bus_t`, but there are a number of classes inside sdbusplu
bus: reduce forward declaration for friendship
Generally we do not want users to be able to get the underlying `sd_bus` pointer held by the `bus_t`, but there are a number of classes inside sdbusplus that do need the bus so that they can make appropriate sd_bus call. Previously, we've required every one of these classes to be forward declared inside `bus.hpp`, which is clutter. Create a new class, with a simple static function, which can be inherited by any internal class and allows access to the underlying `sd_bus*`.
Refactor classes which were previously friends to now inherit from this class.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ide0e7147801d01dc45b255261ba2cafefabddbb1
show more ...
|
a7ac313c | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
slot: explicitly transfer pointer
The slot class is intended to be an RAII wrapper around the C-style `sd_bus_slot*`. As part of the constructor it gets the pointer it is assuming ownership for.
T
slot: explicitly transfer pointer
The slot class is intended to be an RAII wrapper around the C-style `sd_bus_slot*`. As part of the constructor it gets the pointer it is assuming ownership for.
The previous constructor took the `sd_bus_slot*` by value so it was possible that the caller still kept the slot rather than fully transferring ownership. Switch the constructor to an r-value reference so that the caller's pointer can be erased as part of the ownership transfer.
Also, add an assignment operator to simplify the syntax when a slot is first initialized with `nullptr` and then later given ownership of a newly constructed slot.
While this is an incompatible constructor change, it is not expected to affect any current users. The only example of referencing a `slot::slot` I could see in the current OpenBMC org calls the constructor with a `nullptr`, which will seamlessly call the new r-value variant.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I577de2e10e4d5ccae6337c763b848ea4cf2121dd
show more ...
|
a735ca5c | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
vtable: shorten vtable type
Create an alias `sdbusplus::vtable_t` to `sdbusplus::vtable::vtable_t` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0c3a8e40827
vtable: shorten vtable type
Create an alias `sdbusplus::vtable_t` to `sdbusplus::vtable::vtable_t` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0c3a8e40827cb011a07d75c99550a371afdefc64
show more ...
|
0f282c48 | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
bus: shorten bus type
Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9f17892eed5112d4946949861488
bus: shorten bus type
Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9f17892eed5112d49469498614884c02bba86011
show more ...
|
10d7aa12 | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
message: shorten message type
Create an alias `sdbusplus::message_t` to `sdbusplus::message::message` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib400b12f
message: shorten message type
Create an alias `sdbusplus::message_t` to `sdbusplus::message::message` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib400b12fe4a412c0c0c3d26a88f3fae46445cfa8
show more ...
|