-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Android NDK Game Development Cookbook
By :
Synchronization is required to prevent different threads from accessing shared resources simultaneously. A piece of code that accesses a shared resource—that must not be concurrently accessed by more than one thread—is called a critical section (http://en.wikipedia.org/wiki/Critical_section). To avoid race conditions, a mechanism is required at the entry and exit of the critical section. In Windows applications, critical sections are part of the WinAPI and in Android, we use mutexes from the pthread library, which serve the same purpose.
Android native synchronization primitives are POSIX-based. They include thread's management functions, mutexes, conditional variables, and barriers. Take a look at the header file platforms\android-14\arch-arm\usr\include\pthread.h in your NDK folder.
class Mutex
{
public:
Mutex()
{
#if defined...
Change the font size
Change margin width
Change background colour