41 #include "CABundleLocker.h"
48 static pthread_mutex_t sCABundleLocker = PTHREAD_MUTEX_INITIALIZER;
50 #define RECURSIVE_LOCK 0
53 static pthread_once_t sOnce = PTHREAD_ONCE_INIT;
55 static void InitCABundleLocker()
58 pthread_mutexattr_t attr;
59 pthread_mutexattr_init(&attr);
60 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
61 pthread_mutex_init(&sCABundleLocker, &attr);
62 pthread_mutexattr_destroy(&attr);
66 CABundleLocker::CABundleLocker()
69 pthread_once(&sOnce, InitCABundleLocker);
71 pthread_mutex_lock(&sCABundleLocker);
74 CABundleLocker::~CABundleLocker()
76 pthread_mutex_unlock(&sCABundleLocker);