- 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; flagOptFlds = true;
} }
/// <summary> /// <summary>
/// Gets the ResvTms (reservation time) value /// Check if the report control block has the "ResvTms" attribute.
/// </summary> /// </summary>
/// <remarks> /// <returns><c>true</c>, if ResvTms is available, <c>false</c> otherwise.</returns>
/// Only for BRCB. public bool HasResvTms()
/// 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. return ClientReportControlBlock_hasResvTms(self);
/// 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> /// <summary>
/// Sets the ResvTms (reservation time) value /// Gets the ResvTms (reservation time) value
/// </summary> /// </summary>
/// <param name="resvTms">the reservation time value</param> /// <remarks>
public void SetResvTms(Int16 resvTms) /// Only for BRCB.
{ /// Value of -1 indicate the BRCB is exclusively reserved for a set of client based upon configuration.
ClientReportControlBlock_setResvTms (self, resvTms); /// 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> /// <summary>
/// Gets the current owner of the RCB /// Gets the current owner of the RCB

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

Loading…
Cancel
Save