| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| From: Victor Costan <pwnall@chromium.org> |
| Date: Fri, 11 Jan 2019 02:01:53 -0800 |
| Subject: [PATCH 08/17] Adjustments to the page cache to try to avoid harmless |
| TSAN warnings |
| |
| This backports https://www.sqlite.org/src/info/383437be276719ac |
| |
| Bug: 917380 |
| --- |
| third_party/sqlite/src/src/pcache1.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| diff --git a/third_party/sqlite/src/src/pcache1.c b/third_party/sqlite/src/src/pcache1.c |
| index 59c1869ff707..1986b22ca61c 100644 |
| --- a/third_party/sqlite/src/src/pcache1.c |
| +++ b/third_party/sqlite/src/src/pcache1.c |
| @@ -167,6 +167,7 @@ struct PCache1 { |
| unsigned int nMax; /* Configured "cache_size" value */ |
| unsigned int n90pct; /* nMax*9/10 */ |
| unsigned int iMaxKey; /* Largest key seen since xTruncate() */ |
| + unsigned int nPurgeableDummy; /* pnPurgeable points here when not used*/ |
| |
| /* Hash table of all pages. The following variables may only be accessed |
| ** when the accessor is holding the PGroup mutex. |
| @@ -780,8 +781,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){ |
| pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage; |
| pCache->pnPurgeable = &pGroup->nPurgeable; |
| }else{ |
| - static unsigned int dummyCurrentPage; |
| - pCache->pnPurgeable = &dummyCurrentPage; |
| + pCache->pnPurgeable = &pCache->nPurgeableDummy; |
| } |
| pcache1LeaveMutex(pGroup); |
| if( pCache->nHash==0 ){ |
| -- |
| 2.18.0 |
| |