Add FreeBSD platform support (fixes #156) #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds FreeBSD platform support to cpp-ipc by reusing the existing POSIX pthread implementation.
Changes
IPC_OS_FREEBSD_macro tosrc/libipc/platform/detail.hTechnical Details
FreeBSD uses the existing POSIX implementation (
src/libipc/platform/posix/) which provides:PTHREAD_PROCESS_SHARED)PTHREAD_MUTEX_ROBUST)pthread_mutex_timedlock,pthread_cond_timedwait)shm_open,shm_unlink)Why This Approach?
Testing
The changes are minimal and non-invasive:
Ideally, this should be tested on a FreeBSD system to verify:
Files Modified
README.md- Added FreeBSD to platform listsrc/libipc/platform/detail.h- Added FreeBSD platform detectionsrc/libipc/platform/platform.c- Updated conditional compilationsrc/libipc/platform/platform.cpp- Updated conditional compilationsrc/libipc/sync/condition.cpp- Updated conditional compilationsrc/libipc/sync/mutex.cpp- Updated conditional compilationsrc/libipc/sync/semaphore.cpp- Updated conditional compilationsrc/libipc/sync/waiter.cpp- Updated conditional compilationReferences
Related
Closes #156