From 827dc07965d5232a5d7c52840952bb237699555f Mon Sep 17 00:00:00 2001 From: Richard Holland Date: Tue, 5 Dec 2023 13:47:54 +0000 Subject: [PATCH] make server_definitions caching thread_local --- src/ripple/rpc/handlers/ServerDefinitions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ripple/rpc/handlers/ServerDefinitions.cpp b/src/ripple/rpc/handlers/ServerDefinitions.cpp index f9a443c47..622163e98 100644 --- a/src/ripple/rpc/handlers/ServerDefinitions.cpp +++ b/src/ripple/rpc/handlers/ServerDefinitions.cpp @@ -422,11 +422,11 @@ doServerDefinitions(RPC::JsonContext& context) uint32_t curLgrSeq = context.ledgerMaster.getValidatedLedger()->info().seq; // static values used for cache - static uint32_t lastGenerated = 0; // last ledger seq it was generated - static Json::Value lastFeatures{ - Json::objectValue}; // the actual features JSON last generated - static uint256 lastFeatureHash; // the hash of the features JSON last time - // it was generated + static thread_local uint32_t lastGenerated = 0; // last ledger seq it was generated + static thread_local Json::Value lastFeatures{ + Json::objectValue}; // the actual features JSON last generated + static thread_local uint256 lastFeatureHash; // the hash of the features JSON last time + // it was generated // if a flag ledger has passed since it was last generated, regenerate it, // update the cache above