232 Commits

Author SHA1 Message Date
Omkar Bhor c4708c7bd7 Fix double destructor call in buffered_channel and unbuffered_channel iterators
Commit 37b5f770 (#209) added an explicit destructor call in operator++() for
channel iterators. Later, commit e4406238 (#258) added the same destructor
call inside increment_() which operator++() calls. This results in the
destructor running twice on every iterator increment, causing undefined
behavior (double-free) for non-trivially-destructible types.

This bug affects all users of range-for loops over buffered_channel and
unbuffered_channel with types like std::string, shared_ptr, etc.

Fix by removing the redundant destructor call in operator++() since
increment_() already handles it correctly.

Regression test uses a type with an atomic destruction counter to verify
objects are destroyed exactly once.
2026-05-27 19:20:34 +05:30
Rene Rivera 2a16362e2d Add missing import-search for cconfig/predef checks. 2024-05-04 23:29:18 -05:00
Rene Rivera eafb83ae82 Make the library modular usable. 2024-03-11 08:38:17 -05:00
Benjamin Kaufmann 446f23aec6 Add test for issue #268
The test case hangs without a fix for the issue.
2021-01-19 16:10:04 +01:00
EGuesnet cfa5e1d865 split-stack flag for GCC 2020-06-26 14:19:36 +02:00
Oliver Kowalke 34436549ba unbuffered_channel: resume fiber blocked in unbuffered_channel<>::push()
- in context of #181
- fiber blocked in unbuffered_channel>::push() will be resumed by
  unbuffered_channel<>::close()
- returns channel_op_status::closed in this case
2018-10-06 08:28:43 +02:00
Oliver Kowalke aee67c214e re-enable libstdc++ 4.8
- in context of #152
2018-06-27 11:29:49 +02:00
Oliver Kowalke a76f54fcf3 move NUMA to separate library
- in context of #172
2018-05-13 09:20:38 +02:00
Oliver Kowalke 41b008950f uni-test: do not build ucontext for Android 2018-02-19 16:06:35 +01:00
Oliver Kowalke 003312e00d unit-tests: remove double registered tests 2018-02-09 17:30:52 +01:00
Daniela Engert 7a5028827d Most members of std::allocate are deprecated in C++17
And so is std::allocator<void>. Replace them by their cousins from std::allocator_traits. In addition to that, use std:allocator_traits wherever possible. Without that, heaps of deprecation warnings will fall onto humble users when compiling with MSVC 15 in C++17 mode.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-01-01 19:28:45 +01:00
Oliver Kowalke a2b526204a disable pin-thread tests 2017-12-30 08:36:14 +01:00
Oliver Kowalke 7ff5a3564b NUMA: pin thread to CPU via std::thread::native_handle()
- in context of #148
2017-12-29 06:34:35 +01:00
oliver Kowalke 933f8c34ab fix conditional rule for MacOS X 2017-11-08 13:34:28 +01:00
Oliver Kowalke 8559169a21 disabel topology unit-test for MacOS X 2017-11-08 06:29:32 +01:00
Oliver Kowalke 0dbba0bb0d disable unit-tests using ucontext as implementation 2017-11-07 19:21:49 +01:00
Oliver Kowalke 736a2f5d8d add feature-defect macro for std::regex 2017-11-06 18:00:23 +01:00
Oliver Kowalke bac1125f0e unit-test: fix regex error caused by gcc-4.8 bug 2017-11-01 21:21:37 +01:00
Oliver Kowalke 0986f9d1e6 fix compiler warnings in unit-tests 2017-06-10 15:01:23 +02:00
Oliver Kowalke 1ddea95ccc fiber unit-tests pass pointer instead of reference (MSVC-14.0 issue) 2017-06-08 23:22:08 +02:00
Oliver Kowalke 90403fd89f adjust timeouts in unit-test 2017-06-08 23:22:08 +02:00
Oliver Kowalke 05ebaa456e Revert "keep debug symbols in unit-tests"
This reverts commit 2a6ab2aa85.
2017-06-03 09:59:40 +02:00
Oliver Kowalke 2a6ab2aa85 keep debug symbols in unit-tests 2017-06-02 06:09:33 +02:00
Oliver Kowalke 6b651c1ec1 add unit-tests for native APIs 2017-05-30 20:53:02 +02:00
Oliver Kowalke d2152b0403 fix warnings in unit-tests 2017-05-30 20:25:57 +02:00
Oliver Kowalke d89e5389bb unit-tests: build parameters speed/release 2017-05-27 17:12:36 +02:00
Oliver Kowalke 87c5f1e404 NUMA support 2017-05-06 22:19:57 +02:00
Oliver Kowalke 0a6384dd77 fix buffered_channel synchronization 2017-03-30 20:46:30 +02:00
oliver Kowalke 20ca3705e7 pass stack-allocator to fiber in async()
- stack-allocator was mistakenly passed as argument to packaged_task<>
- additional overload for async() taking stack-allocator for fiber and
  allocator for packaged_task<>
2017-01-12 09:11:25 +01:00
oliver Kowalke fffb7e7f32 check support for std::mutex and std::thread 2016-12-13 08:19:15 +01:00
Oliver Kowalke b53e167a68 support for channels refactored
- buffered_channel: MPMC with lock-free guarantees
- unbuffered_channel: rendezvous point
2016-10-30 19:33:49 +01:00
Oliver Kowalke ce962f9688 (un)bounded_channel renamed to (un)bounded_queue 2016-10-13 20:17:01 +02:00
oliver Kowalke 8497508c36 unite-tests: apply defect macro for thread_local 2016-09-15 08:59:22 +02:00
oliver Kowalke 6a13a1e772 fix unit-tests regarding to returning moveable-only type 2016-06-27 11:15:05 +02:00
oliver Kowalke f5dda504ae fix test/Jamfile.v2 requirements 2016-06-17 08:26:08 +02:00
Oliver Kowalke e3ebf6f6ef rename "launch_policy" to "launch" 2016-05-08 10:01:52 +02:00
Oliver Kowalke 2dbea898d4 introduction of launch_policies dispatch and post
- dispatch: execute new fiber immediately, suspend current fiber
- post: enqueue new fiber in ready-queue, continue executing current
fiber
2016-04-28 20:35:26 +02:00
Oliver Kowalke 57267ec957 remove support for fiber interruption 2016-04-19 18:16:31 +02:00
Oliver Kowalke a48c0eb491 fix include of headers 2016-02-27 20:07:06 +01:00
Oliver Kowalke 3522245899 link unit-tests against boost.thread 2016-02-13 11:25:02 +01:00
Oliver Kowalke 91ece536bd provide impl for move-ops in test_async 2016-02-07 12:01:47 +01:00
Oliver Kowalke aa0bdfffa6 fix unit-tests 2016-02-03 17:08:19 +01:00
Oliver Kowalke da14401975 enhance tests 2016-02-03 16:56:28 +01:00
Oliver Kowalke 056a681459 fix fiber-exceptions 2015-12-26 19:52:21 +01:00
Oliver Kowalke 80b281ea34 remove fiber::operator bool() 2015-12-25 20:30:03 +01:00
Oliver Kowalke d09ab56a05 RVO instead rvalue test_future 2015-12-21 14:51:31 +01:00
Oliver Kowalke 8c80a4510c re-factor unit-tests for condition_variable(_any) 2015-12-18 18:26:17 +01:00
Oliver Kowalke 5392f9a4da add unit-tests regarding to using std::bind() 2015-12-17 20:00:32 +01:00
Oliver Kowalke 742467f938 make test_future_mt C++1 conform 2015-12-13 14:20:06 +01:00
Oliver Kowalke 570b0a9ea9 rename condition -> condition_variable 2015-12-13 13:46:26 +01:00