[common] add a reference counted buffer type

This allows buffers to be shared between different asynchronous operations.
Once all users no longer need the buffer, it will be freed.

The motivation for this is being able to stream Wayland clipboard data
asynchronously to multiple clients. The buffer should only be freed after
the clipboard has changed and all ongoing transfer completes.
This commit is contained in:
Quantum
2021-02-11 04:01:52 -05:00
committed by Geoffrey McRae
parent 800f063a1d
commit db16efe68b
3 changed files with 78 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ set(COMMON_SOURCES
src/option.c
src/framebuffer.c
src/KVMFR.c
src/countedbuffer.c
)
add_library(lg_common STATIC ${COMMON_SOURCES})