diff options
author | Zephyron <zephyron@citron-emu.org> | 2025-01-26 14:21:36 +1000 |
---|---|---|
committer | Zephyron <zephyron@citron-emu.org> | 2025-01-26 14:21:36 +1000 |
commit | a5d62fa4ec854174ddbb279e9f826ecc3bc470f0 (patch) | |
tree | 6042cf08f9d023ff45f3c994265b0c59806ecfa9 /src/common/thread.cpp | |
parent | a6063bbd64ffe5ab823c7f0f75fe3eddb4ad2e90 (diff) |
nvnflinger: Implement reference counting for binder objects
Implements proper reference counting for binder objects based on the official
documentation. This adds both weak and strong reference counting support to
the IBinder interface and its implementations (BufferQueueProducer and
BufferQueueConsumer).
The implementation follows the documented behavior where:
- type 0 affects weak references
- type 1 affects strong references
- During initialization: {addval=1, type=0} followed by {addval=1, type=1}
- For onFirstRef: {addval=1, type=1}
- For onLastStrongRef: {addval=-1, type=1}
Reference counters are implemented using std::atomic to ensure thread safety.
REFS: switchbrew.org/wiki/Nvnflinger_services#AdjustRefcount
Diffstat (limited to 'src/common/thread.cpp')
0 files changed, 0 insertions, 0 deletions