/ Check-in [64840a3c]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix the sqlite3_mutex_alloc() interface to return NULL (not segfault) when operating in threadsafe mode. (This is a general-purpose bug fix which really ought to be ported to trunk.)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: 64840a3caf569959c9d5e63bdbc0cf675fda3882
User & Date: drh 2010-05-01 11:19:08
Context
2010-05-01
11:33
Fix a typo in the walmode.test test script introducted yesterday. check-in: dcabc90c user: drh tags: wal
11:19
Fix the sqlite3_mutex_alloc() interface to return NULL (not segfault) when operating in threadsafe mode. (This is a general-purpose bug fix which really ought to be ported to trunk.) check-in: 64840a3c user: drh tags: wal
08:30
Add test case demonstrating deadlock during recovery of very large log files. No fix yet. check-in: 63ea318e user: dan tags: wal
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/mutex.c.

73
74
75
76
77
78
79

80
81
82
83
84
85
86
  return rc;
}

/*
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
*/
sqlite3_mutex *sqlite3_mutex_alloc(int id){

#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return 0;
#endif
  return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
}

sqlite3_mutex *sqlite3MutexAlloc(int id){







>







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
  return rc;
}

/*
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
*/
sqlite3_mutex *sqlite3_mutex_alloc(int id){
  if( !sqlite3GlobalConfig.bCoreMutex ) return 0;
#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return 0;
#endif
  return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
}

sqlite3_mutex *sqlite3MutexAlloc(int id){