SQlite源码分析

互斥锁结构体

    #include <pthread.h>

引用的是unix下支持的锁的形式。静态互斥体结构体定义如下 //递归式互斥量基本体 struct sqlite3_mutex { pthread_mutex_t mutex; / Mutex controlling the lock /

#if SQLITE_MUTEX_NREF
  int id;                    /* Mutex type */
  volatile int nRef;         /* Number of entrances */
  volatile pthread_t owner;  /* Thread that is within this mutex */
  int trace;                 /* True to trace changes */
#endif
};