-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Go bindings for seqlock.cpp | ||
|
||
- `ffi.h` is from `seqlock.cpp/seqlock/include/seqlock/ffi.h` | ||
- `libseqlock.a` is from `seqlock.cpp/build_rel/seqlock/libseqlock.a` after `cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../` in `build_rel` | ||
|
||
The above two files are updated on each version upgrade. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <stdbool.h> | ||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
struct SingleWriterSeqLock { | ||
void* lock; | ||
void* shm; // optional | ||
void* shared_data; | ||
size_t shared_data_size; | ||
bool shared; | ||
}; | ||
|
||
struct SingleWriterSeqLock* seqlock_single_writer_create(char* data, size_t size); | ||
struct SingleWriterSeqLock* seqlock_single_writer_create_shared(const char* filename, size_t size); | ||
void seqlock_single_writer_destroy(struct SingleWriterSeqLock*); | ||
void seqlock_single_writer_load(struct SingleWriterSeqLock* wrapper_lock, char* dst, size_t size); | ||
void seqlock_single_writer_store(struct SingleWriterSeqLock* wrapper_lock, char* src, size_t size); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters