summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-22 21:33:09 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-22 21:33:09 +0100
commit0ae75f2a4e3107271924311b93327ff4b6c24e8c (patch)
treede8e8aeb888202ce04fdb7e29d02cb607905d74a /src/player.cpp
parent0e5e49736c0a5fa29bca257bafc02d7c7a7171c9 (diff)
downloadminetest-0ae75f2a4e3107271924311b93327ff4b6c24e8c.tar.gz
minetest-0ae75f2a4e3107271924311b93327ff4b6c24e8c.tar.bz2
minetest-0ae75f2a4e3107271924311b93327ff4b6c24e8c.zip
Player: Fix a deadlock triggered by previous commit 0e5e49736c0a5fa29bca257bafc02d7c7a7171c9
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 88c5634e3..08cb24248 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "player.h"
#include <fstream>
+#include "jthread/jmutexautolock.h"
#include "util/numeric.h"
#include "hud.h"
#include "constants.h"
@@ -241,6 +242,7 @@ void Player::deSerialize(std::istream &is, std::string playername)
u32 Player::addHud(HudElement *toadd)
{
JMutexAutoLock lock(m_mutex);
+
u32 id = getFreeHudID();
if (id < hud.size())