- IedServer: fixed potential deadlock when IedServer_stop is directly called after IedServer_start

pull/179/head
Michael Zillgith 7 years ago
parent 287769dcba
commit f2c811c7c7

@ -746,32 +746,41 @@ namespace IEC61850
flagOptFlds = true;
}
/// <summary>
/// Gets the ResvTms (reservation time) value
/// </summary>
/// <remarks>
/// Only for BRCB.
/// Value of -1 indicate the BRCB is exclusively reserved for a set of client based upon configuration.
/// Value of 0 means that the BRCB is not reserved.
/// Positive value indicates that the BRCB is reserved dynamically and the value is the number of
/// seconds for reservation after association loss.
/// </remarks>
/// <returns>The reservation time</returns>
public Int16 GetResvTms()
{
return ClientReportControlBlock_getResvTms (self);
}
/// <summary>
/// Check if the report control block has the "ResvTms" attribute.
/// </summary>
/// <returns><c>true</c>, if ResvTms is available, <c>false</c> otherwise.</returns>
public bool HasResvTms()
{
return ClientReportControlBlock_hasResvTms(self);
}
/// <summary>
/// Sets the ResvTms (reservation time) value
/// </summary>
/// <param name="resvTms">the reservation time value</param>
public void SetResvTms(Int16 resvTms)
{
ClientReportControlBlock_setResvTms (self, resvTms);
/// <summary>
/// Gets the ResvTms (reservation time) value
/// </summary>
/// <remarks>
/// Only for BRCB.
/// Value of -1 indicate the BRCB is exclusively reserved for a set of client based upon configuration.
/// Value of 0 means that the BRCB is not reserved.
/// Positive value indicates that the BRCB is reserved dynamically and the value is the number of
/// seconds for reservation after association loss.
/// </remarks>
/// <returns>The reservation time</returns>
public Int16 GetResvTms()
{
return ClientReportControlBlock_getResvTms(self);
}
flagResvTms = true;
}
/// <summary>
/// Sets the ResvTms (reservation time) value
/// </summary>
/// <param name="resvTms">the reservation time value</param>
public void SetResvTms(Int16 resvTms)
{
ClientReportControlBlock_setResvTms(self, resvTms);
flagResvTms = true;
}
/// <summary>
/// Gets the current owner of the RCB

@ -567,9 +567,6 @@ singleThreadedServerThread(void* parameter)
bool running = true;
mmsMapping->reportThreadFinished = false;
mmsMapping->reportThreadRunning = true;
if (DEBUG_IED_SERVER)
printf("IED_SERVER: server thread started!\n");
@ -602,6 +599,9 @@ IedServer_start(IedServer self, int tcpPort)
#if (CONFIG_MMS_SINGLE_THREADED == 1)
MmsServer_startListeningThreadless(self->mmsServer, tcpPort);
self->mmsMapping->reportThreadFinished = false;
self->mmsMapping->reportThreadRunning = true;
self->serverThread = Thread_create((ThreadExecutionFunction) singleThreadedServerThread, (void*) self, false);
Thread_start(self->serverThread);

Loading…
Cancel
Save