@@ -636,7 +636,7 @@ ClientInterface::~ClientInterface()
636
636
Delete clients
637
637
*/
638
638
{
639
- MutexAutoLock clientslock (m_clients_mutex);
639
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
640
640
641
641
for (auto &client_it : m_clients) {
642
642
// Delete client
@@ -648,7 +648,7 @@ ClientInterface::~ClientInterface()
648
648
std::vector<session_t > ClientInterface::getClientIDs (ClientState min_state)
649
649
{
650
650
std::vector<session_t > reply;
651
- MutexAutoLock clientslock (m_clients_mutex);
651
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
652
652
653
653
for (const auto &m_client : m_clients) {
654
654
if (m_client.second ->getState () >= min_state)
@@ -660,7 +660,7 @@ std::vector<session_t> ClientInterface::getClientIDs(ClientState min_state)
660
660
661
661
void ClientInterface::markBlockposAsNotSent (const v3s16 &pos)
662
662
{
663
- MutexAutoLock clientslock (m_clients_mutex);
663
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
664
664
for (const auto &client : m_clients) {
665
665
if (client.second ->getState () >= CS_Active)
666
666
client.second ->SetBlockNotSent (pos);
@@ -705,7 +705,7 @@ void ClientInterface::UpdatePlayerList()
705
705
infostream << " * " << player->getName () << " \t " ;
706
706
707
707
{
708
- MutexAutoLock clientslock (m_clients_mutex);
708
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
709
709
RemoteClient* client = lockedGetClientNoEx (i);
710
710
if (client)
711
711
client->PrintInfo (infostream);
@@ -724,7 +724,7 @@ void ClientInterface::send(session_t peer_id, u8 channelnum,
724
724
725
725
void ClientInterface::sendToAll (NetworkPacket *pkt)
726
726
{
727
- MutexAutoLock clientslock (m_clients_mutex);
727
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
728
728
for (auto &client_it : m_clients) {
729
729
RemoteClient *client = client_it.second ;
730
730
@@ -739,7 +739,7 @@ void ClientInterface::sendToAll(NetworkPacket *pkt)
739
739
void ClientInterface::sendToAllCompat (NetworkPacket *pkt, NetworkPacket *legacypkt,
740
740
u16 min_proto_ver)
741
741
{
742
- MutexAutoLock clientslock (m_clients_mutex);
742
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
743
743
for (auto &client_it : m_clients) {
744
744
RemoteClient *client = client_it.second ;
745
745
NetworkPacket *pkt_to_send = nullptr ;
@@ -763,7 +763,7 @@ void ClientInterface::sendToAllCompat(NetworkPacket *pkt, NetworkPacket *legacyp
763
763
764
764
RemoteClient* ClientInterface::getClientNoEx (session_t peer_id, ClientState state_min)
765
765
{
766
- MutexAutoLock clientslock (m_clients_mutex);
766
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
767
767
RemoteClientMap::const_iterator n = m_clients.find (peer_id);
768
768
// The client may not exist; clients are immediately removed if their
769
769
// access is denied, and this event occurs later then.
@@ -792,7 +792,7 @@ RemoteClient* ClientInterface::lockedGetClientNoEx(session_t peer_id, ClientStat
792
792
793
793
ClientState ClientInterface::getClientState (session_t peer_id)
794
794
{
795
- MutexAutoLock clientslock (m_clients_mutex);
795
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
796
796
RemoteClientMap::const_iterator n = m_clients.find (peer_id);
797
797
// The client may not exist; clients are immediately removed if their
798
798
// access is denied, and this event occurs later then.
@@ -804,7 +804,7 @@ ClientState ClientInterface::getClientState(session_t peer_id)
804
804
805
805
void ClientInterface::setPlayerName (session_t peer_id, const std::string &name)
806
806
{
807
- MutexAutoLock clientslock (m_clients_mutex);
807
+ RecursiveMutexAutoLock clientslock (m_clients_mutex);
808
808
RemoteClientMap::iterator n = m_clients.find (peer_id);
809
809
// The client may not exist; clients are immediately removed if their
810
810
// access is denied, and this event occurs later then.
@@ -814,7 +814,7 @@ void ClientInterface::setPlayerName(session_t peer_id, const std::string &name)
814
814
815
815
void ClientInterface::DeleteClient (session_t peer_id)
816
816
{
817
- MutexAutoLock conlock (m_clients_mutex);
817
+ RecursiveMutexAutoLock conlock (m_clients_mutex);
818
818
819
819
// Error check
820
820
RemoteClientMap::iterator n = m_clients.find (peer_id);
@@ -844,7 +844,7 @@ void ClientInterface::DeleteClient(session_t peer_id)
844
844
845
845
void ClientInterface::CreateClient (session_t peer_id)
846
846
{
847
- MutexAutoLock conlock (m_clients_mutex);
847
+ RecursiveMutexAutoLock conlock (m_clients_mutex);
848
848
849
849
// Error check
850
850
RemoteClientMap::iterator n = m_clients.find (peer_id);
@@ -860,7 +860,7 @@ void ClientInterface::CreateClient(session_t peer_id)
860
860
void ClientInterface::event (session_t peer_id, ClientStateEvent event)
861
861
{
862
862
{
863
- MutexAutoLock clientlock (m_clients_mutex);
863
+ RecursiveMutexAutoLock clientlock (m_clients_mutex);
864
864
865
865
// Error check
866
866
RemoteClientMap::iterator n = m_clients.find (peer_id);
@@ -881,7 +881,7 @@ void ClientInterface::event(session_t peer_id, ClientStateEvent event)
881
881
882
882
u16 ClientInterface::getProtocolVersion (session_t peer_id)
883
883
{
884
- MutexAutoLock conlock (m_clients_mutex);
884
+ RecursiveMutexAutoLock conlock (m_clients_mutex);
885
885
886
886
// Error check
887
887
RemoteClientMap::iterator n = m_clients.find (peer_id);
@@ -896,7 +896,7 @@ u16 ClientInterface::getProtocolVersion(session_t peer_id)
896
896
void ClientInterface::setClientVersion (session_t peer_id, u8 major, u8 minor, u8 patch,
897
897
const std::string &full)
898
898
{
899
- MutexAutoLock conlock (m_clients_mutex);
899
+ RecursiveMutexAutoLock conlock (m_clients_mutex);
900
900
901
901
// Error check
902
902
RemoteClientMap::iterator n = m_clients.find (peer_id);
0 commit comments