Skip to content

Commit 0c46492

Browse files
committed
Disable clang's -Wthread-safety-negative
Using this option with -fsanitize=thread requires annotating the code using macros. This may be done later if anyone requires it. Fixed grammar and style issues in README.md Signed-off-by: Ted Lyngmo <ted@lyncon.se>
1 parent fbc37bd commit 0c46492

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class timer_queue<R(Args...), Clock, TimePoint>;
2121
```
2222

2323
---
24-
A timer queue provides constant time lookup of the first event to timeout, at the expense of logarithmic insertion and extraction.
24+
A timer queue provides constant-time lookup of the first event to timeout, at the expense of logarithmic insertion and extraction.
2525

2626
#### Template parameters
2727

@@ -59,21 +59,21 @@ A timer queue provides constant time lookup of the first event to timeout, at th
5959
| ![](./svg/spacer.svg)<br>Functions to add single events | |
6060
|-|-|
6161
|`void emplace_do(event_type ev)`| Add an event. If `SetDelayEnabled` is `true`, adds `now_delay` to the current time. This is also affected by `set_delay_until` (see below). |
62-
|`void emplace_do_urgently(event_type ev)`| Add an event, placing the event last among those added with `emplace_do_urgently`, but before all other events in queue |
62+
|`void emplace_do_urgently(event_type ev)`| Add an event, placing the event last among those added with `emplace_do_urgently`, but before all other events in the queue |
6363
|`void emplace_do_at(time_point tp, event_type ev)` | Add an event that is due at the specified `time_point` |
6464
|`void emplace_do_in(duration dur, event_type)` | Add an event that is due after the specified `duration` |
6565

6666
| ![](./svg/spacer.svg)<br>Functions to add events in bulk | |
6767
|-|-|
68-
|`template<class Iter>`<br>`void emplace_schedule(Iter first, Iter last)` | Place a number of events in queue. If `SetDelayEnabled`, adds `now_delay` to the current time. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `event_type`. This overload is also affected by `set_delay_until` (see below). |
69-
|`template<class Iter>`<br>`void emplace_schedule(Iter first, Iter last)` | Place a number of events in queue. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `schedule_at_type`.|
70-
|`template<class Iter>`<br>`void emplace_schedule(Iter first, Iter last)` | Place a number of events in queue in relation to `clock_type::now()`. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `schedule_in_type`.|
71-
|`template<class Iter>`<br>`void emplace_schedule(time_point T0, Iter first, Iter last)` | Place a number of events in queue in relation to `T0`. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `schedule_in_type`.|
68+
|`template<class Iter>`<br>`void emplace_schedule(Iter first, Iter last)` | Place a number of events in the queue. If `SetDelayEnabled`, adds `now_delay` to the current time. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `event_type`. This overload is also affected by `set_delay_until` (see below). |
69+
|`template<class Iter>`<br>`void emplace_schedule(Iter first, Iter last)` | Place a number of events in the queue. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `schedule_at_type`.|
70+
|`template<class Iter>`<br>`void emplace_schedule(Iter first, Iter last)` | Place a number of events in the queue in relation to `clock_type::now()`. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `schedule_in_type`.|
71+
|`template<class Iter>`<br>`void emplace_schedule(time_point T0, Iter first, Iter last)` | Place a number of events in the queue in relation to `T0`. This overload only participates in overload resolution if `std::iterator_traits<Iter>::value_type` is `schedule_in_type`.|
7272

7373
| ![](./svg/spacer.svg)<br>Functions to perform synchronized tasks | |
7474
|-|-|
75-
|`template<class Re, class Func>`<br>`Re synchronize(Func&& func)`|Execute `func`, that should return `Re`, in the task queue and wait for the execution to complete. This overload only participates in overload resolution if `R` is `void`.|
76-
|`template<class Re, class Func>`<br>`Re synchronize(Func&& func, R&& event_loop_return_value = R{})`|Execute `func`, that should return `Re`, in the task queue and wait for the execution to complete. The value returned by the event when executed in the event loop is stored in `event_loop_return_value`. This overload only participates in overload resolution if `R` is not `void`.|
75+
|`template<class Re, class Func>`<br>`Re synchronize(Func&& func)`|Execute `func`, which should return `Re`, in the task queue and wait for the execution to complete. This overload only participates in overload resolution if `R` is `void`.|
76+
|`template<class Re, class Func>`<br>`Re synchronize(Func&& func, R&& event_loop_return_value = R{})`|Execute `func`, which should return `Re`, in the task queue and wait for the execution to complete. The value returned by the event when executed in the event loop is stored in `event_loop_return_value`. This overload only participates in overload resolution if `R` is not `void`.|
7777

7878

7979
| ![](./svg/spacer.svg)<br>Functions to extract events | |
@@ -87,9 +87,9 @@ A timer queue provides constant time lookup of the first event to timeout, at th
8787
| `void shutdown()` | Shutdown the queue, leaving unprocessed events in the queue |
8888
| `void clear()` | Removes unprocessed events from the queue |
8989
| `void restart()` | Restarts the queue with unprocessed events intact |
90-
| `std::size_t size() const` | Returns the number of events in queue |
90+
| `std::size_t size() const` | Returns the number of events in the queue |
9191
| `bool operator!() const` | Returns `true` if `shutdown()` has been called, `false` otherwise |
92-
| `bool is_open() const` | Returns `true` if `shutdown()` has _not_ been called, `false`otherwise |
92+
| `bool is_open() const` | Returns `true` if `shutdown()` has _not_ been called, `false` otherwise |
9393
| `explicit operator bool() const` | Returns the same as `is_open()` |
9494

9595
| ![](./svg/spacer.svg)<br>Queue registration | Usually only used by `lyn::mq::timer_queue_registrator` |
@@ -128,7 +128,7 @@ A `timer_queue_registrator` is a RAII wrapper used to register a user (usually a
128128
|`timer_queue_registrator(timer_queue_registrator&& other) noexcept`|A `timer_queue_registrator` is move-constructible|
129129
|`timer_queue_registrator& operator=(const timer_queue_registrator&) = delete`||
130130
|`timer_queue_registrator& operator=(timer_queue_registrator&& other) noexcept`|A `timer_queue_registrator` is move-assignable|
131-
|`~timer_queue_registrator()`|Unregisters from the `timer_queue` supplied at construction|
131+
|`~timer_queue_registrator()`|Unregisters from the `timer_queue` supplied during construction|
132132

133133
| ![](./svg/spacer.svg)<br>Observers ||
134134
|-|-|

include/lyn/timer_queue.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ SOFTWARE.
4343
#include <type_traits>
4444
#include <utility>
4545

46+
#ifdef __clang__
47+
#pragma clang diagnostic push
48+
#pragma clang diagnostic ignored "-Wthread-safety-negative"
49+
#endif
50+
4651
namespace lyn::mq {
4752
namespace detail {
4853
// Make sure no promise goes unfulfilled without having to catch exceptions.
@@ -483,4 +488,8 @@ class timer_queue_registrator {
483488

484489
} // namespace lyn::mq
485490

491+
#ifdef __clang__
492+
#pragma clang diagnostic pop
493+
#endif
494+
486495
#endif

0 commit comments

Comments
 (0)