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(); c2_mux.unlock();
break; break;
default: default:
Dump(packet, "ERROR: Got a reflector packet with unknown Codec:"); Dump(packet, "ERROR: Received a reflector packet with unknown Codec:");
break; break;
} }
} }
@ -159,14 +159,10 @@ void CController::AudiotoCodec2(std::shared_ptr<CTranscoderPacket> packet)
// we might be all done... // we might be all done...
if (packet->AllCodecsAreSet()) if (packet->AllCodecsAreSet())
{ {
send_mux.lock();
SendToReflector(packet); 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 // 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 class CController
{ {
public: public:
std::mutex dstar_mux, dmr_mux;
CController(); CController();
bool Start(); bool Start();
void Stop(); void Stop();

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

Loading…
Cancel
Save

Powered by TurnKey Linux.