1. ChannelTest::MultipleSendersReceivers
- Add C++14-compatible latch implementation (similar to C++20 std::latch)
- Ensure receivers are ready before senders start sending messages
- This prevents race condition where senders might send before receivers are listening
2. RWLockTest::ReadWriteReadPattern
- Fix test logic: lock_shared allows multiple concurrent readers
- Previous test had race condition where both threads could read same value
- New test: each thread writes based on thread id (1 or 2), then reads
- Expected result: 1*20 + 2*20 = 60
3. ShmTest::ReleaseMemory
- Correct return value semantics: release() returns ref count before decrement, or -1 on error
- Must call get_mem() to map memory and set ref count to 1 before release
- Expected: release() returns 1 (ref count before decrement)
4. ShmTest::ReferenceCount
- Correct semantics: ref count is 0 after acquire (memory not mapped)
- get_mem() maps memory and sets ref count to 1
- Second acquire+get_mem increases ref count to 2
- Test now properly validates reference counting behavior
5. ShmTest::SubtractReference
- sub_ref() only works after get_mem() has mapped the memory
- Must call get_mem() first to initialize ref count to 1
- sub_ref() then decrements it to 0
- Test now follows correct API usage pattern
- Problem: calling h2.release() followed by shm::remove(id) causes use-after-free
- h2.release() internally calls shm::release(id) which frees the id structure
- shm::remove(id) then accesses the freed id pointer -> crash
- Solution: detach the id from handle first, then call shm::remove(id)
- h2.detach() returns the id without releasing it
- shm::remove(id) can then safely clean up both memory and disk file
- This completes the fix for all ShmTest double-free issues
- Add comprehensive documentation for shm::release(id), shm::remove(id), and shm::remove(name)
- release(id): Decrements ref count, cleans up memory and disk file when count reaches zero
- remove(id): Calls release(id) internally, then forces disk file cleanup (WARNING: do not use after release)
- remove(name): Only removes disk file, safe to use anytime
- Fix critical double-free bug in ShmTest test cases
- Problem: calling release(id) followed by remove(id) causes use-after-free crash
because release() already frees the id structure
- Solution: replace 'release(id); remove(id);' pattern with just 'remove(id)'
- Fixed tests: AcquireCreate, AcquireCreateOrOpen, GetMemory, GetMemoryNoSize,
RemoveById, SubtractReference
- Kept 'release(id); remove(name);' pattern unchanged (safe usage)
- Add explanatory comments in test code to prevent future misuse
- Fix handle class member functions: remove incorrect shm:: prefix
- h.acquire() not h.shm::acquire()
- h.release() not h.shm::release()
- h.sub_ref() not h.shm::sub_ref()
- Keep shm:: prefix for namespace-level global functions:
- shm::acquire(), shm::release(id), shm::get_mem()
- shm::remove(), shm::get_ref(id), shm::sub_ref(id)
- Fix comments to use correct terminology
- Resolves: 'shm::acquire is not a class member' compilation errors
- Remove 'using namespace ipc::shm;' to avoid id_t conflict with system id_t
- Add explicit shm:: namespace prefix to all shm types and functions
- Apply to: id_t, handle, acquire, get_mem, release, remove, get_ref, sub_ref
- Apply to: create and open constants
- Fix comments to avoid incorrect namespace references
- Resolves compilation error: 'reference to id_t is ambiguous'
- Test low-level API (acquire, get_mem, release, remove)
- Test reference counting functionality (get_ref, sub_ref)
- Test high-level handle class interface
- Test all handle methods (valid, size, name, get, etc.)
- Test handle lifecycle (construction, move, swap, assignment)
- Test different access modes (create, open, create|open)
- Test detach/attach functionality
- Test multi-handle access to same memory
- Test data persistence across handles
- Test edge cases (large segments, multiple simultaneous handles)
- Move all existing test files (*.cpp, *.h) to test/archive/
- Rename CMakeLists.txt to CMakeLists.txt.old in archive
- Prepare for comprehensive unit test refactoring