Lewis Baker
6247291b86
Add cppcoro::recursive_generator
2017-06-16 06:42:40 +09:30
Lewis Baker
40c6216266
Add cppcoro::generator<T>.
2017-06-12 23:23:55 +09:30
Lewis Baker
90642dc130
Fix get_return_object() of task/lazy_task promise under clang.
...
Clang didn't seem to allow conversion from get_return_object()
return value to coroutine return value via explicit constructor.
Now get_return_object() explicitly constructs task/lazy_task object
rather than returning coroutine_handle. This required moving
method definition to below task/lazy_task class definition.
2017-06-11 22:06:40 +09:30
Lewis Baker
a270518e27
Use this-> when referencing members of template base-class.
...
Fixes some compilation errors under Clang.
2017-06-11 22:02:29 +09:30
Lewis Baker
5ea2225efe
Use <experimental/filesystem> instead of <filesystem>
...
Clang's libc++ doesn't yet have a <filesystem> header.
2017-06-11 21:48:45 +09:30
Lewis Baker
2e7a0b6c03
Remove use of reinterpret_cast in constexpr expression.
2017-06-11 21:44:47 +09:30
Lewis Baker
8bca9697c2
Fix compilation errors in on_scope_exit/on_scope_failure.
2017-06-11 20:31:51 +09:30
Lewis Baker
29ce3d2727
Avoid use of CALLBACK as template parameter name.
...
Windows.h defines CALLBACK as a macro which causes compile-errors
if included before the cancellation_registration.hpp header.
2017-06-11 20:17:52 +09:30
Lewis Baker
d269d1df27
Remove set_exception() methods from promise types.
...
MSVC 2015 isn't supported any more so we should be able to rely on
unhandled_exception() being supported.
2017-06-11 20:15:21 +09:30
Lewis Baker
30817352c5
Add missing return in io_context::operator=().
2017-05-30 21:25:44 +09:30
Lewis Baker
4a34b948ed
Add [[nodiscard]] to io_context/io_service::schedule().
2017-05-27 21:33:22 +09:30
Lewis Baker
8cf10ce184
Add async file I/O support for Win32 platform.
...
- Adds file, readable_file, writable_file, read_only_file,
write_only_file and read_write_file classes.
- Adds file_share_mode, file_open_mode, file_buffering_mode enums.
- Supports async read/write but only synchronous open for now.
- Removes support for VS 2015 since implementation makes use of
std::optional which is only available in VS 2017.
2017-05-27 21:26:59 +09:30
Lewis Baker
91e9b039b2
Added io_service/io_context scheduler using Win32 IO completion ports.
2017-05-27 09:28:39 +09:30
Lewis Baker
fc5e9ef844
Add cppcoro::on_scope_exit/on_scope_failure/on_scope_success helpers.
2017-05-27 07:00:01 +09:30
Lewis Baker
f7bfad1c50
Add cppcoro::async_generator<T>
2017-05-17 22:11:03 +09:30
Lewis Baker
49eb9d62b5
Conditionally disable set_exception() methods for newer MSVC versions.
...
Newer MSVC versions complain if you have both unhandled_exception()
and set_exception() defined on your promise_type.
2017-05-17 21:37:18 +09:30
Lewis Baker
7a2ce5895b
Add shared_lazy_task<T> class.
2017-05-08 09:04:42 +09:30
Lewis Baker
10fc3b1ecd
Fix cppcoro::make_shared_task() for task<void> case.
...
Work around bug in MSVC by providing special-case overload of
make_shared_task() for task<void>. Add test for this.
2017-05-07 22:30:56 +09:30
Lewis Baker
978b0a3b0d
Add note about cancellation_registration callbacks throwing exceptions.
2017-05-05 22:45:39 +09:30
Lewis Baker
9007c7bf92
Make cancellation_registration more efficient.
...
Now keeps track of approximate number of free slots in a registration
chunk so that entire chunks can often be skipped when scanning for
free slots. Also, starts scanning at a position within the chunk based
on the number of free slots. This should handle typical LIFO cases
more efficiently when accessed from a single thread.
Ideas have been borrowed from .NET CancellationToken implementation.
2017-05-05 22:45:38 +09:30
Lewis Baker
d04f152bf9
Initial version of cancellation_token.
2017-05-02 07:46:09 +09:30
Lewis Baker
5710f40f08
Add cppcoro::shared_task<T>.
2017-04-25 21:48:59 +09:30
Lewis Baker
946d794f9f
Implement move-assignment for task<T> and lazy_task<T>.
2017-04-22 09:09:58 +09:30
Lewis Baker
9b1b6024f4
Add cppcoro::async_mutex.
2017-04-19 22:14:21 +09:30
Lewis Baker
96928055ba
Add lazy_task<T>.
2017-04-04 21:30:49 +09:30
Lewis Baker
996e4ee8fa
Add copyright headers to source files.
2017-04-02 09:44:53 +09:30
Lewis Baker
bbd41b0702
Add cppcoro::task<T> and cppcoro::single_consumer_event.
...
Includes a few tests for basic functionality of task<T>.
2017-04-01 22:02:33 +10:30