Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: third_party/sqlite/sqlite-src-3080704/src/mutex.c

Issue 883353008: [sql] Import reference version of SQLite 3.8.7.4. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hold back encoding change which is messing up patch. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 ** 2007 August 14 2 ** 2007 August 14
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #endif 74 #endif
75 75
76 return rc; 76 return rc;
77 } 77 }
78 78
79 /* 79 /*
80 ** Retrieve a pointer to a static mutex or allocate a new dynamic one. 80 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
81 */ 81 */
82 sqlite3_mutex *sqlite3_mutex_alloc(int id){ 82 sqlite3_mutex *sqlite3_mutex_alloc(int id){
83 #ifndef SQLITE_OMIT_AUTOINIT 83 #ifndef SQLITE_OMIT_AUTOINIT
84 if( sqlite3_initialize() ) return 0; 84 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
85 #endif 85 #endif
86 return sqlite3GlobalConfig.mutex.xMutexAlloc(id); 86 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
87 } 87 }
88 88
89 sqlite3_mutex *sqlite3MutexAlloc(int id){ 89 sqlite3_mutex *sqlite3MutexAlloc(int id){
90 if( !sqlite3GlobalConfig.bCoreMutex ){ 90 if( !sqlite3GlobalConfig.bCoreMutex ){
91 return 0; 91 return 0;
92 } 92 }
93 assert( GLOBAL(int, mutexIsInit) ); 93 assert( GLOBAL(int, mutexIsInit) );
94 return sqlite3GlobalConfig.mutex.xMutexAlloc(id); 94 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 ** intended for use inside assert() statements. 143 ** intended for use inside assert() statements.
144 */ 144 */
145 int sqlite3_mutex_held(sqlite3_mutex *p){ 145 int sqlite3_mutex_held(sqlite3_mutex *p){
146 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p); 146 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
147 } 147 }
148 int sqlite3_mutex_notheld(sqlite3_mutex *p){ 148 int sqlite3_mutex_notheld(sqlite3_mutex *p){
149 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p); 149 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
150 } 150 }
151 #endif 151 #endif
152 152
153 #endif /* SQLITE_MUTEX_OMIT */ 153 #endif /* !defined(SQLITE_MUTEX_OMIT) */
OLDNEW
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/src/mutex.h ('k') | third_party/sqlite/sqlite-src-3080704/src/mutex_noop.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698