added a couple of std::mutex

main
Tom Early 4 years ago
parent 88b966310a
commit ea4720bc74

@ -126,7 +126,7 @@ void CController::ReadReflectorThread()
c2_mux.unlock();
break;
default:
Dump(packet, "ERROR: Got a reflector packet with unknown Codec:");
Dump(packet, "ERROR: Received a reflector packet with unknown Codec:");
break;
}
}
@ -159,14 +159,10 @@ void CController::AudiotoCodec2(std::shared_ptr<CTranscoderPacket> packet)
// we might be all done...
if (packet->AllCodecsAreSet())
{
send_mux.lock();
SendToReflector(packet);
send_mux.unlock();
}
#ifdef DEBUG
if (packet->IsSecond())
{
AppendM17(packet);
}
#endif
}
// The original incoming coded was M17, so we will calculate the audio and then

@ -33,6 +33,8 @@ enum class EAmbeType { dstar, dmr };
class CController
{
public:
std::mutex dstar_mux, dmr_mux;
CController();
bool Start();
void Stop();

@ -451,9 +451,17 @@ void CDV3003::ReadDevice()
continue;
}
if (Encoding::dstar == type)
{
Controller.dstar_mux.lock();
Controller.RouteDstPacket(packet);
Controller.dstar_mux.unlock();
}
else
{
Controller.dmr_mux.lock();
Controller.RouteDmrPacket(packet);
Controller.dmr_mux.unlock();
}
}
}
}

Loading…
Cancel
Save

Powered by TurnKey Linux.