Commit graph

14 commits

Author SHA1 Message Date
Alexandre Bouvier
5c2cf39455 tests: update catch2 to 3.0.1 2023-01-05 04:58:31 +01:00
Liam
e551960935 common/fiber: make fibers easier to use 2022-07-02 12:33:49 -04:00
Morph
2b87305d31 general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
bunnei
e4b692bd16 common: Fiber: use a reference for YieldTo.
- Fixes another small leak.
2021-03-07 13:46:53 -08:00
bunnei
845a217d5e Revert "core: Switch to unique_ptr for usage of Common::Fiber." 2021-03-05 17:08:17 -08:00
bunnei
3322f10f84 core: Switch to unique_ptr for usage of Common::Fiber.
- With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context.
- Fixes a memory leak due to circular reference of the shared pointer.
2021-02-27 11:56:04 -08:00
Morph
23413c0d44 general: Fix various spelling errors 2021-01-02 10:23:41 -05:00
ReinUsesLisp
08ad5c4e42 tests: Fix data race in fibers test
Previous to this commit, the tests were using operator[] from
unordered_map to query elements but this silently inserts empty elements
when they don't exist. If all threads were executed without concurrency,
this wouldn't be an issue, but the same unordered_map could be written
from two threads at the same time. This is a data race and makes some
previously inserted elements invisible for a short period of time,
causing them to insert and return an empty element. This default
constructed element (a zero) was used to index an array of fibers that
asserted when one of them was nullptr, shutting the test session off.

To address this issue, lock on thread id reads and writes. This could be
a shared mutex to allow concurrent reads, but the definition of
std::this_thread::get_id is fuzzy when using non-standard techniques
like fibers. I opted to use a standard mutex.

While we are at it, fix the included headers.
2020-10-28 01:41:24 -03:00
Fernando Sahmkow
94a51e6b21 Core/Common: Address Feedback. 2020-06-27 18:20:06 -04:00
Fernando Sahmkow
1460bdc5ab Common/Fiber: Implement Rewinding. 2020-06-18 16:29:25 -04:00
Fernando Sahmkow
564713fb46 Common/Tests: Address Feedback 2020-06-18 16:29:21 -04:00
Fernando Sahmkow
09d2ffa663 Common/Tests: Clang Format. 2020-06-18 16:29:19 -04:00
Fernando Sahmkow
a1e7931d20 Common: Polish Fiber class, add comments, asserts and more tests. 2020-06-18 16:29:15 -04:00
Fernando Sahmkow
279ff1c0ff Tests: Add tests for fibers and refactor/fix Fiber class 2020-06-18 16:29:15 -04:00