summaryrefslogtreecommitdiff
path: root/src/particles.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-11 13:58:43 +0200
committerGitHub <noreply@github.com>2017-06-11 13:58:43 +0200
commit65819f3b9f8229666a30b91ef2d289ebc6085097 (patch)
tree722ba29a49ea1707c1db2633b2e84c5c7ebfe2eb /src/particles.cpp
parentff73c7a5da6ab8ac0bb678ebf25b83e805397029 (diff)
downloadminetest-65819f3b9f8229666a30b91ef2d289ebc6085097.tar.gz
minetest-65819f3b9f8229666a30b91ef2d289ebc6085097.tar.bz2
minetest-65819f3b9f8229666a30b91ef2d289ebc6085097.zip
Use thread_local instead from some static settings (#5955)
thread_local permits to limit variable lifetime to thread duration. Use it on each setting place which uses static to cache variable result only for thread lifetime. This permits to keep the same performance level & reconfigure server from MT gui in those various variables places. Add thread_local to undersampling calculation too.
Diffstat (limited to 'src/particles.cpp')
-rw-r--r--src/particles.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/particles.cpp b/src/particles.cpp
index e89e182e6..fe681fe6c 100644
--- a/src/particles.cpp
+++ b/src/particles.cpp
@@ -294,7 +294,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment* env)
{
m_time += dtime;
- static const float radius =
+ static thread_local const float radius =
g_settings->getS16("max_block_send_distance") * MAP_BLOCKSIZE;
bool unloaded = false;