Skip to content

Commit

Permalink
Various minor updates and update the README
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Feb 7, 2015
1 parent 23ffc41 commit 2e1af00
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -112,7 +112,7 @@ endif()
# using the default implementation in std::atomic, which uses a lock.
if (NOT USE_AMD64_CMPXCHG16B)
message(WARNING "The CMPXCHG16B instruction has been disabled. Make sure "
"to define LIBASyNC_NO_CMPXCHG16B in all files that include "
"to define LIBASYNC_NO_CMPXCHG16B in all files that include "
"async++.h because this affects the library ABI.")
target_compile_definitions(Async++ PUBLIC LIBASYNC_NO_CMPXCHG16B)
endif()
Expand Down
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -73,13 +73,13 @@ Building and Installing
-----------------------
Instructions for compiling Async++ and using it in your code are available on the [Building and Installing](https://github.com/Amanieu/asyncplusplus/wiki/Building-and-Installing) page.

Tutorial
--------
The [Tutorial](https://github.com/Amanieu/asyncplusplus/wiki/Tutorial) provides a step-by-step guide to all the features of Async++.

API Reference
-------------
The [API Reference](https://github.com/Amanieu/asyncplusplus/wiki/API-Reference) gives detailed descriptions of all the classes and functions available in Async++.
Documentation
------------
The Async++ documentation is split into four parts:
- [Tasks](https://github.com/Amanieu/asyncplusplus/wiki/Tasks): This describes task objects which are the core Async++. Reading this first is strongly recommended.
- [Parallel algorithms](https://github.com/Amanieu/asyncplusplus/wiki/Parallel-algorithms): This describes functions to run work on ranges in parallel.
- [Schedulers](https://github.com/Amanieu/asyncplusplus/wiki/Schedulers): This describes the low-level details of Async++ and how to customize it.
- [API Reference](https://github.com/Amanieu/asyncplusplus/wiki/API-Reference): This gives detailed descriptions of all the classes and functions available in Async++.

Contact
-------
Expand Down
16 changes: 7 additions & 9 deletions include/async++/cancel.h
Expand Up @@ -51,20 +51,18 @@ class cancellation_token {
{
state.store(true, std::memory_order_release);
}
};

// Cancel the current task by throwing a task_canceled exception. This is
// prefered to another exception type because it is handled more efficiently.
inline void cancel_current_task()
{
LIBASYNC_THROW(task_canceled());
}
void reset()
{
state.store(false, std::memory_order_relaxed);
}
};

// Interruption point, calls cancel_current_task if the specified token is set.
// Interruption point, throws task_canceled if the specified token is set.
inline void interruption_point(const cancellation_token& token)
{
if (token.is_canceled())
cancel_current_task();
LIBASYNC_THROW(task_canceled());
}

} // namespace async
1 change: 1 addition & 0 deletions include/async++/scheduler_fwd.h
Expand Up @@ -51,6 +51,7 @@ class scheduler_ref {
template<typename T>
static void invoke_sched(void* sched, task_run_handle&& t)
{
static_assert(is_scheduler<T>::value, "Type is not a valid scheduler");
static_cast<T*>(sched)->schedule(std::move(t));
}

Expand Down
2 changes: 1 addition & 1 deletion include/async++/task.h
Expand Up @@ -232,7 +232,7 @@ class basic_event {
}

// Get the task linked to this event. This can only be called once.
task<Result> get_task() const
task<Result> get_task()
{
#ifndef NDEBUG
// Catch use of uninitialized task objects
Expand Down

0 comments on commit 2e1af00

Please sign in to comment.