OLD | NEW |
1 /* | 1 /* |
2 ** 2008 October 07 | 2 ** 2008 October 07 |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 */ | 100 */ |
101 static int debugMutexInit(void){ return SQLITE_OK; } | 101 static int debugMutexInit(void){ return SQLITE_OK; } |
102 static int debugMutexEnd(void){ return SQLITE_OK; } | 102 static int debugMutexEnd(void){ return SQLITE_OK; } |
103 | 103 |
104 /* | 104 /* |
105 ** The sqlite3_mutex_alloc() routine allocates a new | 105 ** The sqlite3_mutex_alloc() routine allocates a new |
106 ** mutex and returns a pointer to it. If it returns NULL | 106 ** mutex and returns a pointer to it. If it returns NULL |
107 ** that means that a mutex could not be allocated. | 107 ** that means that a mutex could not be allocated. |
108 */ | 108 */ |
109 static sqlite3_mutex *debugMutexAlloc(int id){ | 109 static sqlite3_mutex *debugMutexAlloc(int id){ |
110 static sqlite3_debug_mutex aStatic[6]; | 110 static sqlite3_debug_mutex aStatic[SQLITE_MUTEX_STATIC_APP3 - 1]; |
111 sqlite3_debug_mutex *pNew = 0; | 111 sqlite3_debug_mutex *pNew = 0; |
112 switch( id ){ | 112 switch( id ){ |
113 case SQLITE_MUTEX_FAST: | 113 case SQLITE_MUTEX_FAST: |
114 case SQLITE_MUTEX_RECURSIVE: { | 114 case SQLITE_MUTEX_RECURSIVE: { |
115 pNew = sqlite3Malloc(sizeof(*pNew)); | 115 pNew = sqlite3Malloc(sizeof(*pNew)); |
116 if( pNew ){ | 116 if( pNew ){ |
117 pNew->id = id; | 117 pNew->id = id; |
118 pNew->cnt = 0; | 118 pNew->cnt = 0; |
119 } | 119 } |
120 break; | 120 break; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 #endif /* SQLITE_DEBUG */ | 195 #endif /* SQLITE_DEBUG */ |
196 | 196 |
197 /* | 197 /* |
198 ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation | 198 ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation |
199 ** is used regardless of the run-time threadsafety setting. | 199 ** is used regardless of the run-time threadsafety setting. |
200 */ | 200 */ |
201 #ifdef SQLITE_MUTEX_NOOP | 201 #ifdef SQLITE_MUTEX_NOOP |
202 sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ | 202 sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ |
203 return sqlite3NoopMutex(); | 203 return sqlite3NoopMutex(); |
204 } | 204 } |
205 #endif /* SQLITE_MUTEX_NOOP */ | 205 #endif /* defined(SQLITE_MUTEX_NOOP) */ |
206 #endif /* SQLITE_MUTEX_OMIT */ | 206 #endif /* !defined(SQLITE_MUTEX_OMIT) */ |
OLD | NEW |