History log of /fuchsia/zircon/system/ulib/async/wait.cpp
Revision Date Author Comments
# 239d7d87 16-Jul-2018 mukesh agrawal <quiche@google.com>

[async] update documentation for WaitBase::Cancel()

Note the following:
1. The class-level documentaton for WaitBase indicates that an instance
must only be used with single-threaded dispatchers.
2. The same documentation indicates that a WaitBase instance can only
be accessed from the dispatch thread.
3. WaitBase::Dispatch() clears the wait's pending state before yielding
control flow to the target of the wait.

Then, if we assume that the dispatcher invokes a wait's handler
immediately after reading the wait from the port (rather than queuing
the wait for later processing), it follows that async_cancel_wait()
can never return ZX_ERR_NOT_FOUND for a wait that WaitBase::Cancel()
believes to be pending.

Update the Cancel() documentation to reflect this assumption and its
consequences, and add a corresponding runtime assertion.

Test: fx full-build (for x64)
Change-Id: Ief06c2ec8b53bddacd9289a474dabfe044f19424


# fabb8fe6 04-Jul-2018 David Moore <davemoore@google.com>

[async] Change async_t -> async_dispatcher_t

Change name of dispatcher type from async_t to async_dispatcher_t
Keep typedef of async_t for compatibility

Change async_{get,set}_default() to async_{get,set}_default_dispatcher()
Again, keep compatible apis until other layers have been modified to use
new api.

Bug:ZX-2337
Test:CQ
Change-Id: If0b5d061fd114d60e23078dbb5f2a6ed9ed6f6cc


# 89d2b24d 10-Apr-2018 Jeff Brown <jeffbrown@google.com>

[async] Tidy up the libasync API futher.

Deleted WaitWithTimeout since it is no longer used.
Removed flags and reserved storage.
Removed return code from wait handler.
Removed *_or_report_error variants after further consideration.
Deleted the non-RAII variants of the C++ wrappers; these wrappers
might as well be safe to use. Clients desiring minimum overhead
can use the C API instead if they prefer.
Made the C++ wrappers more systematic; each one has a fbl::Function
and a Method based variant.
Added a C++ wrapper for Tasks which takes a no-arg closure.
Improved consistency across all async operations, including docs.
Ported all programs to the new API as required.
Beefed up the tests.

Change-Id: I97beca26cec6d94fa7efd282c8d2620cdbcb84e5


# fa67e541 08-Mar-2018 James Robinson <jamesr@google.com>

[async] Move async headers to match naming rules

The naming rules for C/C++ header files that are extensively used but
not part of the 'system headers' or 'global headers' as defined by
https://fuchsia.googlesource.com/docs/+/master/development/languages/c-cpp/naming.md#include-paths
states that the include lines for headers in the 'async' library should
be spelled like this:

<lib/async/dispatcher.h>

This moves the header files from system/ulib/async/include/async/dispatcher.h
to system/ulib/async/include/lib/async/dispatcher.h and updates
includes to match.

Change-Id: I85de9f17d67605d59df763be54715a1f2aa9ed77


# 296fb2ac 29-Jan-2018 Adam Barth <abarth@google.com>

[async] Separate fbl dependency from async_t

The C++ FIDL support library in Garnet wants to be able to use async_t
without linking against libfbl. Previously, the C declarations needed
create an async_wait_t were in the same header as code that depended on
fbl, which meant C++ clients of async_wait_t were forced to depend on
fbl.

After this change, the C++ wrappers for libasync interfaces are
separated from the core C declarations.

Change-Id: Ic172911a9dc775d5b5e540a33ce87d2dc218a3d9


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# cc83cdd9 06-Sep-2017 Jeff Brown <jeffbrown@google.com>

[async] API and assertion cleanups.

Added some more documentation especially to clarify destructor behavior.

Removed virtual destructors since the classes were made final by the
previous refactoring.

Tidied up some assertions to be more consistent and informative.

Change-Id: Ifa7c1a99e22548c59baf9bb666219790b3096b73


# 2bfe671b 05-Sep-2017 Jeff Brown <jeffbrown@google.com>

[async] Use mxtl::Function<> instead of subclassing ops.

Now that we have mxtl::Function<> we can make the asynchronous operation
wrappers much more convenient to use in C++ by using a callback style
interface rather than subclassing.

The runtime performance characteristics should be essentially identical
due to how mxtl::Function<> works.

Change-Id: Id96d0e888b27187c3f0caaeed897d43172df3911


# d7d1e4e8 05-Sep-2017 Jeff Brown <jeffbrown@google.com>

[async] Split async.h into multiple headers and use mxtl/macros.h.

Change-Id: I00d6a2479b0ebee467c73ac16f7c1c2533d9379c