/ Check-in [28cfdabc47]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use the database mutex where applicable.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | get-trace
Files: files | file ages | folders
SHA1: 28cfdabc471e132a856292781767777c6390ea3c
User & Date: mistachkin 2015-05-12 23:33:32
Context
2015-05-13
04:52
Merge updates from trunk. Leaf check-in: 10ee36d012 user: mistachkin tags: get-trace
2015-05-12
23:33
Use the database mutex where applicable. check-in: 28cfdabc47 user: mistachkin tags: get-trace
23:31
Fix a couple of typos in comments. check-in: e908365fae user: mistachkin tags: get-trace
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  1771   1771     void **ppArg
  1772   1772   ){
  1773   1773   #ifdef SQLITE_ENABLE_API_ARMOR
  1774   1774     if( !sqlite3SafetyCheckOk(db) || pxTrace==0 || ppArg==0 ){
  1775   1775       return SQLITE_MISUSE_BKPT;
  1776   1776     }
  1777   1777   #endif
         1778  +  sqlite3_mutex_enter(db->mutex);
  1778   1779     *pxTrace = db->xTrace;
  1779   1780     *ppArg = db->pTraceArg;
         1781  +  sqlite3_mutex_leave(db->mutex);
  1780   1782     return SQLITE_OK;
  1781   1783   }
  1782   1784   /*
  1783   1785   ** Register a profile function.  The pArg from the previously registered 
  1784   1786   ** profile function is returned.  
  1785   1787   **
  1786   1788   ** A NULL profile function means that no profiling is executes.  A non-NULL
................................................................................
  1816   1818     void **ppArg
  1817   1819   ){
  1818   1820   #ifdef SQLITE_ENABLE_API_ARMOR
  1819   1821     if( !sqlite3SafetyCheckOk(db) || pxProfile==0 || ppArg==0 ){
  1820   1822       return SQLITE_MISUSE_BKPT;
  1821   1823     }
  1822   1824   #endif
         1825  +  sqlite3_mutex_enter(db->mutex);
  1823   1826     *pxProfile = db->xProfile;
  1824   1827     *ppArg = db->pProfileArg;
         1828  +  sqlite3_mutex_leave(db->mutex);
  1825   1829     return SQLITE_OK;
  1826   1830   }
  1827   1831   #endif /* SQLITE_OMIT_TRACE */
  1828   1832   
  1829   1833   /*
  1830   1834   ** Register a function to be invoked when a transaction commits.
  1831   1835   ** If the invoked function returns non-zero, then the commit becomes a