互斥锁结构体

静态互斥体结构体定义如下,上锁时使用一个静态结构体,故解释了上锁时导致整改数据库上锁,因为一个实例就这么一个静态结构体,一旦上锁,就阻塞

    //递归式互斥量基本体
    struct sqlite3_mutex {
      CRITICAL_SECTION mutex;    /* Mutex controlling the lock */
      int id;                    /* Mutex type */                    //id为类型
    #ifdef SQLITE_DEBUG
      volatile int nRef;         /* Number of enterances */
      volatile DWORD owner;      /* Thread holding this mutex */
      int trace;                 /* True to trace changes */
    #endif
    };

results matching ""

    No results matching ""