From ccb2113a622f4d119f97185a59d088910cf827b7 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 19 Jun 2020 11:34:57 +0000 Subject: [PATCH] Refactoring various names. No changes in the resulting machine code. FossilOrigin-Name: 7bb08b1bfcf184e4b59c8c9028926a0052612ff6a6731914ccdb8dee07ea4a98 --- manifest | 33 ++++++++++++----- manifest.uuid | 2 +- src/btree.c | 8 ++--- src/btreeInt.h | 2 +- src/date.c | 6 ++-- src/loadext.c | 10 +++--- src/main.c | 6 ++-- src/mutex_unix.c | 2 +- src/mutex_w32.c | 2 +- src/notify.c | 16 ++++----- src/os.c | 8 ++--- src/os_unix.c | 8 ++--- src/os_win.c | 8 ++--- src/pager.c | 6 ++-- src/sqlite.h.in | 26 ++++++++------ src/sqliteInt.h | 18 ++++------ src/test1.c | 2 +- src/test_multiplex.c | 2 +- src/test_osinst.c | 4 +-- src/vdbeaux.c | 84 ++++++++++++++++++++++---------------------- 20 files changed, 135 insertions(+), 118 deletions(-) diff --git a/manifest b/manifest index b8bd183351..f9d8b2a0cf 100644 --- a/manifest +++ b/manifest @@ -1,6 +1,6 @@ B fd5abb1a7b5a55127d5c0d5ff448020d8bccab44e4f5afe1eb88fc19578af735 -C Fix\san\sassert()\sthat\scould\sfail\swhen\soperating\son\sa\sdatabase\swith\sa\scorrupt\sschema. -D 2020-06-17T20:29:56.720 +C Refactoring\svarious\snames.\s\sNo\schanges\sin\sthe\sresulting\smachine\scode. +D 2020-06-19T11:34:57.555 F configure f594931bd7b23dad12db96b81e1dba43b41b30a4560d6eb008014e3d9f1617e8 x F configure.ac 13e4ecf89214c3aa0ba099a9e0178f13f03261ace627126737d8cee240ec5c1c F doc/wal-lock.md 781726aaba20bafeceb7ba9f91d5c98c6731691b30c954e37cf0b49a053d461d @@ -9,17 +9,32 @@ F ext/session/session_common.tcl f613174665456b2d916ae8df3e5735092a1c1712f36f468 F ext/session/sessioninvert.test 04075517a9497a80d39c495ba6b44f3982c7371129b89e2c52219819bc105a25 F ext/session/sqlite3session.c fc8c6c13dc0456943ff24abf574ced10418eec66a548c97d3eafbebe9fc5e908 F src/alter.c b8ffe4acd48b4fe793d01901f28fd4f3b037854a0e99f0c977738556c31b9d2b -F src/btree.c e6db473ab10c52d1bc51dd8d21795dde07b7502426314b91d9d246a714e50416 +F src/btree.c d9d7813a28f9c337908858aa46d6129d43cd790bc87c62146cd6915bb412150c +F src/btreeInt.h 401f0549caa02cce8791baeb673aa570ee35c89ce53a7628a3d21804784c23d0 F src/build.c 8245e69aa1a2f8b67e76203fdbaa9f88deccd89b5ed41f7097c202b920484fd0 +F src/date.c 9f1d31ef1bfdc732a83459e05770f6d5aeb57a7e323b48f1798cb870125601ef F src/expr.c 36bb737d2ca78ee9bd4fde46cf1e51a37e7e1b263e55fccfaef32922a19e9524 F src/global.c 0409ae635839e0bef26a69b68be64126ab6cba62ac19bd7694f1652e591c4c17 +F src/loadext.c 436af4968c6954d304fce9efa12719367bd8f37b19b93b71d6ad607e85adbb47 +F src/main.c 84b2ddb649a4fb470abaa980ff41242819812b6a6c08fc0baa2c024b175bc76b +F src/mutex_unix.c dd2b3f1cc1863079bc1349ac0fec395a500090c4fe4e11ab775310a49f2f956d +F src/mutex_w32.c caa50e1c0258ac4443f52e00fe8aaea73b6d0728bd8856bedfff822cae418541 +F src/notify.c 89a97dc854c3aa62ad5f384ef50c5a4a11d70fcc69f86de3e991573421130ed6 +F src/os.c 80e4cf3e5da06be03ca641661e331ce60eeeeabf0d7354dbb1c0e166d0eedbbe +F src/os_unix.c 94bd41f5c058db79ccdf7c51627b8917d98423c0899ec5e5b9b3a6fd36e8b2ff +F src/os_win.c 92f7ed3dd12fcc30b65815fa524fb7c4c6f9a1c9aa44c4b7c46759fc42f66105 +F src/pager.c 7d6cff7a2aca0aacedb15eb67b4a7fb67c39725a1e02d1a6a7bb6573a61a51a1 F src/select.c 6ddd86a7272ff1f443bd9efcbb0f5ab590674d4c732e4cb8c3d5dd8e3a70cae6 F src/shell.c.in ffd3de9cb7294919fe1b56c49f9d62fc4b049015c4727c934f3d1880128c56e3 -F src/sqliteInt.h 0a13c93b250270c5876da65c21963eaca60c5fc55271c313d5f6cf20547134af -F src/test1.c e9f68f157f8fd027ee4c32c4b427f4eed274749bfb745427e2d954fa89d95ad3 +F src/sqlite.h.in d2c03414a8ee5d4a6855c04dd7cd5998e45139b0fe66b65bae86d4223edd091f +F src/sqliteInt.h 5f9b119efd2c628780b5cfb628170c6c2393a1ca46e75b0fe83abb9660bf02c9 +F src/test1.c 8442b50ecbbce891a9e490e54879e6bcc540590be591451c296ec6c57640847d +F src/test_multiplex.c d0ee44ec77687b35e83fd6b9fca4c5860f603b1b407fd375be62437b79af5ae3 +F src/test_osinst.c d341f9d7613e007c8c3f7eba6cd307230047506aa8f97858c1fd21f5069616bd F src/trigger.c 6b1472e6b5bbca71e13f95c61ebcd0b255450352de8254a42c40222020b7ac43 F src/vacuum.c b196258ea36cfed5f455f18519345613bab04daf0e038a63ee715407c5a7ae9e F src/vdbe.c 985f92b5131d62654c3c26062a2e55b1c8f71c2e10497e23021c6650d5c392b3 +F src/vdbeaux.c 4c4716795d47505e25e209c45f3448810d1458fee5210fd1e3759557872de10e F src/vtab.c 33ecf1d8b0fd1508fe23be9da40e48909c86a13db2725e273177eb47db2fc265 F src/window.c 88a63e6948ea924b3cf9ad8aff5ea1fa53bebdb2f13340867205fda16ed0f19c F test/corruptL.test 16564fa7961fcce242945177c9bdaa5cb5dc85d6248612dbe4b927d059eb6014 @@ -33,7 +48,7 @@ F test/where.test f5e62453537e5b335b69f3b09f8a02ce3328289fad5d866e25371284b837d7 F test/whereG.test 9363b2a97d914cb1b81aff5069ef0cf2a071a67e2b604eac6fe9c0114017d9aa F test/window1.test 9d7f4990e5b36d95af93b189da4aa75216c6690ce95cced3c8b6d3234be51c2c F test/without_rowid3.test 96426a6c9a2a5cf62bbe55ea1ad038eaaf4bf743f40a1ad517233b8e5a3d4339 -P 4adc0a1b0d84c2df6d6bf0d5d9d3fa9f7d048af8d232c4beb77518727890f212 -R d5c913bb4696618860d8e215a52de60c -U dan -Z 29e5aef02689c7bbd9ca814e67e739ba +P 4a340c9bc7d939efc947e3b17ca79314482f74368b15567dd089d40e4270890e +R 9833b56461d0ff6ff79be23099c8a427 +U drh +Z 362d8b86a61aefc35e02371751514139 diff --git a/manifest.uuid b/manifest.uuid index 8e41a9dab6..4eea227159 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4a340c9bc7d939efc947e3b17ca79314482f74368b15567dd089d40e4270890e \ No newline at end of file +7bb08b1bfcf184e4b59c8c9028926a0052612ff6a6731914ccdb8dee07ea4a98 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 0ed295e0aa..0c83bc6040 100644 --- a/src/btree.c +++ b/src/btree.c @@ -69,7 +69,7 @@ int sqlite3BtreeTrace=1; /* True to enable tracing */ ** but the test harness needs to access it so we make it global for ** test builds. ** -** Access to this variable is protected by SQLITE_MUTEX_STATIC_MASTER. +** Access to this variable is protected by SQLITE_MUTEX_STATIC_MAIN. */ #ifdef SQLITE_TEST BtShared *SQLITE_WSD sqlite3SharedCacheList = 0; @@ -2422,7 +2422,7 @@ int sqlite3BtreeOpen( #if SQLITE_THREADSAFE mutexOpen = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_OPEN); sqlite3_mutex_enter(mutexOpen); - mutexShared = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); + mutexShared = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); sqlite3_mutex_enter(mutexShared); #endif for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){ @@ -2541,7 +2541,7 @@ int sqlite3BtreeOpen( pBt->nRef = 1; if( p->sharable ){ MUTEX_LOGIC( sqlite3_mutex *mutexShared; ) - MUTEX_LOGIC( mutexShared = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);) + MUTEX_LOGIC( mutexShared = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);) if( SQLITE_THREADSAFE && sqlite3GlobalConfig.bCoreMutex ){ pBt->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_FAST); if( pBt->mutex==0 ){ @@ -2635,7 +2635,7 @@ static int removeFromSharingList(BtShared *pBt){ int removed = 0; assert( sqlite3_mutex_notheld(pBt->mutex) ); - MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); ) + MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); ) sqlite3_mutex_enter(pMaster); pBt->nRef--; if( pBt->nRef<=0 ){ diff --git a/src/btreeInt.h b/src/btreeInt.h index ec25b54662..2e3f7105cd 100644 --- a/src/btreeInt.h +++ b/src/btreeInt.h @@ -381,7 +381,7 @@ struct Btree { ** ** Fields in this structure are accessed under the BtShared.mutex ** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MASTER mutex. The pPager field +** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field ** may not be modified once it is initially set as long as nRef>0. ** The pSchema field may be set once under BtShared.mutex and ** thereafter is unchanged as long as nRef>0. diff --git a/src/date.c b/src/date.c index fff062fb5a..9cba27f591 100644 --- a/src/date.c +++ b/src/date.c @@ -515,7 +515,7 @@ static int osLocaltime(time_t *t, struct tm *pTm){ #if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S struct tm *pX; #if SQLITE_THREADSAFE>0 - sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); + sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); #endif sqlite3_mutex_enter(mutex); pX = localtime(t); @@ -1211,10 +1211,10 @@ static void currentTimeFunc( #if HAVE_GMTIME_R pTm = gmtime_r(&t, &sNow); #else - sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); + sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN)); pTm = gmtime(&t); if( pTm ) memcpy(&sNow, pTm, sizeof(sNow)); - sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); + sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN)); #endif if( pTm ){ strftime(zBuf, 20, zFormat, &sNow); diff --git a/src/loadext.c b/src/loadext.c index 067c47c17f..7007e3137d 100644 --- a/src/loadext.c +++ b/src/loadext.c @@ -689,7 +689,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff){ ** The following object holds the list of automatically loaded ** extensions. ** -** This list is shared across threads. The SQLITE_MUTEX_STATIC_MASTER +** This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN ** mutex must be held while accessing this list. */ typedef struct sqlite3AutoExtList sqlite3AutoExtList; @@ -731,7 +731,7 @@ int sqlite3_auto_extension( { u32 i; #if SQLITE_THREADSAFE - sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); + sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); #endif wsdAutoextInit; sqlite3_mutex_enter(mutex); @@ -769,7 +769,7 @@ int sqlite3_cancel_auto_extension( void (*xInit)(void) ){ #if SQLITE_THREADSAFE - sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); + sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); #endif int i; int n = 0; @@ -796,7 +796,7 @@ void sqlite3_reset_auto_extension(void){ #endif { #if SQLITE_THREADSAFE - sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); + sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); #endif wsdAutoextInit; sqlite3_mutex_enter(mutex); @@ -826,7 +826,7 @@ void sqlite3AutoLoadExtensions(sqlite3 *db){ for(i=0; go; i++){ char *zErrmsg; #if SQLITE_THREADSAFE - sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); + sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); #endif #ifdef SQLITE_OMIT_LOAD_EXTENSION const sqlite3_api_routines *pThunk = 0; diff --git a/src/main.c b/src/main.c index 9f99cbdf3a..6056478519 100644 --- a/src/main.c +++ b/src/main.c @@ -241,12 +241,12 @@ int sqlite3_initialize(void){ if( rc ) return rc; /* Initialize the malloc() system and the recursive pInitMutex mutex. - ** This operation is protected by the STATIC_MASTER mutex. Note that + ** This operation is protected by the STATIC_MAIN mutex. Note that ** MutexAlloc() is called for a static mutex prior to initializing the ** malloc subsystem - this implies that the allocation of a static ** mutex must not require support from the malloc subsystem. */ - MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); ) + MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); ) sqlite3_mutex_enter(pMaster); sqlite3GlobalConfig.isMutexInit = 1; if( !sqlite3GlobalConfig.isMallocInit ){ @@ -3112,7 +3112,7 @@ static int openDatabase( SQLITE_OPEN_MAIN_JOURNAL | SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_SUBJOURNAL | - SQLITE_OPEN_MASTER_JOURNAL | + SQLITE_OPEN_SUPER_JOURNAL | SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_WAL diff --git a/src/mutex_unix.c b/src/mutex_unix.c index 9282d28016..2afaddec69 100644 --- a/src/mutex_unix.c +++ b/src/mutex_unix.c @@ -112,7 +112,7 @@ static int pthreadMutexEnd(void){ return SQLITE_OK; } **