Commit 6395d689 authored by Claes Sjofors's avatar Claes Sjofors

plc, nmps lock wasn't removed at runtime stop

parent 3988bfa5
...@@ -112,9 +112,8 @@ void NMpsCell_init( pwr_sClass_NMpsCell *object) ...@@ -112,9 +112,8 @@ void NMpsCell_init( pwr_sClass_NMpsCell *object)
{ {
plc_t_DataInfo *data_index; plc_t_DataInfo *data_index;
int i; int i;
pwr_tStatus sts;
nmps_create_lock( &sts); // nmps_create_lock( &sts);
if ( !(object->Function & NMPS_CELLFUNC_BACKUP)) if ( !(object->Function & NMPS_CELLFUNC_BACKUP))
NMpsCell_init_time( object); NMpsCell_init_time( object);
...@@ -706,9 +705,8 @@ void NMpsStoreCell_init( pwr_sClass_NMpsStoreCell *object) ...@@ -706,9 +705,8 @@ void NMpsStoreCell_init( pwr_sClass_NMpsStoreCell *object)
{ {
plc_t_DataInfo *data_index; plc_t_DataInfo *data_index;
int i; int i;
pwr_tStatus sts;
nmps_create_lock( &sts); // nmps_create_lock( &sts);
if ( !(object->Function & NMPS_CELLFUNC_BACKUP)) if ( !(object->Function & NMPS_CELLFUNC_BACKUP))
NMpsCell_init_time( (pwr_sClass_NMpsCell *) object); NMpsCell_init_time( (pwr_sClass_NMpsCell *) object);
...@@ -1163,7 +1161,7 @@ void NMpsStoreCell_exec( ...@@ -1163,7 +1161,7 @@ void NMpsStoreCell_exec(
if (( object->Function & NMPS_CELLFUNC_SINGELSELECT) || if (( object->Function & NMPS_CELLFUNC_SINGELSELECT) ||
( object->Function & NMPS_CELLFUNC_ONESELECT)) ( object->Function & NMPS_CELLFUNC_ONESELECT))
{ {
/* Unselect everone exept last selected */ /* Unselect everyone except last selected */
if ( object->DataSelected > 1) if ( object->DataSelected > 1)
{ {
data_index = (plc_t_DataInfo *) &object->Data1P; data_index = (plc_t_DataInfo *) &object->Data1P;
......
...@@ -299,6 +299,13 @@ init_process ( char *name) ...@@ -299,6 +299,13 @@ init_process ( char *name)
exit(sts); exit(sts);
} }
nmps_create_lock( &sts);
if (EVEN(sts)) {
errh_Fatal("nmps_create_lock, %m", sts);
errh_SetStatus( PWR__SRVTERM);
exit(sts);
}
if ( strstr( name, "rt_plc_core") != 0) if ( strstr( name, "rt_plc_core") != 0)
pp->is_core = 1; pp->is_core = 1;
...@@ -582,6 +589,7 @@ clean_all ( ...@@ -582,6 +589,7 @@ clean_all (
if (EVEN(sts)) if (EVEN(sts))
errh_Error("gdh_UnrefObjectInfoAll, %m", sts); errh_Error("gdh_UnrefObjectInfoAll, %m", sts);
nmps_delete_lock( &sts);
} }
/* Link to I/O base areas. /* Link to I/O base areas.
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "rt_sect.h" #include "rt_sect.h"
#include "rt_nmps_lock.h" #include "rt_nmps_lock.h"
sect_sHead *nmps_locksect = 0; static sect_sHead *nmps_locksect = 0;
void nmps_create_lock( pwr_tStatus *sts) void nmps_create_lock( pwr_tStatus *sts)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment