Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -1773,12 +1773,14 @@ #ifdef SQLITE_ENABLE_API_ARMOR if( !sqlite3SafetyCheckOk(db) || pxTrace==0 || ppArg==0 ){ return SQLITE_MISUSE_BKPT; } #endif + sqlite3_mutex_enter(db->mutex); *pxTrace = db->xTrace; *ppArg = db->pTraceArg; + sqlite3_mutex_leave(db->mutex); return SQLITE_OK; } /* ** Register a profile function. The pArg from the previously registered ** profile function is returned. @@ -1818,12 +1820,14 @@ #ifdef SQLITE_ENABLE_API_ARMOR if( !sqlite3SafetyCheckOk(db) || pxProfile==0 || ppArg==0 ){ return SQLITE_MISUSE_BKPT; } #endif + sqlite3_mutex_enter(db->mutex); *pxProfile = db->xProfile; *ppArg = db->pProfileArg; + sqlite3_mutex_leave(db->mutex); return SQLITE_OK; } #endif /* SQLITE_OMIT_TRACE */ /*