core-cpp 0.4.2
Added
core::log::ScopedCapture::snapshot(): a copy of what the capture holds, taken under its
lock, for reading while other threads still log into it.text()is unchanged -- a reference to
the buffer itself -- and is valid only while no thread logs into the capture, once the writers
are joined.
Fixed
core::log::ScopedCapturetakes lines from several threads at once. Its sink appended to a
std::stringwithout a lock, so a test whose code logged from two threads corrupted the heap
(contour's Windows test crash). Every append now takes a mutex, and so docontains(),
count(),lines()and the newsnapshot(). No signature changes.DetachedTaskno longer reads a freed frame under clang-cl at-O0(core-cpp#51). A
trivial empty return object is returned in a register, and clang-cl without optimisation kept the
starting call's copy of it in the coroutine frame and reloaded it from there after the first
suspension. When that suspension handed the coroutine to something that ran it to its end first
-- a pool thread, an event loop on another thread, anawait_suspendthat resumes inline -- the
frame was already freed. fastcached's shutdown flows, which hop onto a loop from another thread
and finish there, have this shape.DetachedTask's destructor is now defaulted out of line,
which makes it user-provided, so every ABI returns it through a pointer the caller owns. The type
is no longer trivially destructible, trivially copyable or an aggregate;DetachedTask{}still
works through its default constructor, and its members and behaviour are unchanged.
Full Changelog: v0.4.1...v0.4.2