Synchronizing native threads with reader/writer locks at Android NDK
The previous two recipes cover thread synchronization with mutex and conditional variables. This recipe discusses reader/writer locks in Android NDK.
Getting ready...
Readers are recommended to read the previous two recipes, Synchronizing native threads with mutex at Android NDK and Synchronizing native threads with conditional variables at Android NDK, before going through this one.
How to do it...
The following steps will help you create an Android project that demonstrates the usage of the pthread reader/writer lock:
- Create an Android application named
NativeThreadsRWLock
. Set the package name ascookbook.chapter6.nativethreadsrwlock
. Refer to the Loading native libraries and ...
Get Android Native Development Kit Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.