diff --git a/src/client/ua_client_subscriptions.c b/src/client/ua_client_subscriptions.c index ff42a1d2bf4..5d5285e575f 100644 --- a/src/client/ua_client_subscriptions.c +++ b/src/client/ua_client_subscriptions.c @@ -71,8 +71,6 @@ ua_Subscriptions_create(UA_Client *client, UA_Client_Subscription *newSub, static void ua_Subscriptions_create_handler(UA_Client *client, void *data, UA_UInt32 requestId, void *r) { - UA_LOCK_ASSERT(&client->clientMutex, 0); - UA_CreateSubscriptionResponse *response = (UA_CreateSubscriptionResponse *)r; CustomCallback *cc = (CustomCallback *)data; UA_Client_Subscription *newSub = (UA_Client_Subscription *)cc->clientData; diff --git a/src/pubsub/ua_pubsub_ns0.c b/src/pubsub/ua_pubsub_ns0.c index ded20a500f2..792ef6ba644 100644 --- a/src/pubsub/ua_pubsub_ns0.c +++ b/src/pubsub/ua_pubsub_ns0.c @@ -807,7 +807,6 @@ addPubSubConnectionAction(UA_Server *server, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_StatusCode res = addPubSubConnectionLocked(server, sessionId, sessionHandle, methodId, methodContext, @@ -824,7 +823,6 @@ removeConnectionAction(UA_Server *server, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output){ - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_StatusCode retVal = UA_STATUSCODE_GOOD; UA_NodeId nodeToRemove = *((UA_NodeId *) input[0].data); retVal |= UA_Server_removePubSubConnection(server, nodeToRemove); @@ -967,8 +965,6 @@ addDataSetFolderAction(UA_Server *server, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output){ - UA_LOCK_ASSERT(&server->serviceMutex, 0); - /* defined in R 1.04 9.1.4.5.7 */ UA_StatusCode retVal = UA_STATUSCODE_GOOD; UA_String newFolderName = *((UA_String *) input[0].data); @@ -1102,7 +1098,6 @@ addPublishedDataItemsAction(UA_Server *server, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output){ - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_StatusCode retVal = UA_STATUSCODE_GOOD; size_t fieldNameAliasesSize = input[1].arrayLength; UA_String * fieldNameAliases = (UA_String *) input[1].data; @@ -1278,8 +1273,6 @@ readContentMask(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, UA_Boolean includeSourceTimeStamp, const UA_NumericRange *range, UA_DataValue *value) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_WriterGroup *writerGroup = (UA_WriterGroup*)nodeContext; if((writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED && writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED_NODELETE) || @@ -1300,8 +1293,6 @@ writeContentMask(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, const UA_NumericRange *range, const UA_DataValue *value) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_WriterGroup *writerGroup = (UA_WriterGroup*)nodeContext; if((writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED && writerGroup->config.messageSettings.encoding != UA_EXTENSIONOBJECT_DECODED_NODELETE) || @@ -1465,8 +1456,6 @@ removeGroupAction(UA_Server *server, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output){ - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_NodeId nodeToRemove = *((UA_NodeId *)input->data); if(UA_WriterGroup_findWGbyId(server, nodeToRemove)) { UA_WriterGroup *wg = UA_WriterGroup_findWGbyId(server, nodeToRemove); @@ -1858,7 +1847,6 @@ removeDataSetWriterAction(UA_Server *server, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output){ - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_NodeId nodeToRemove = *((UA_NodeId *) input[0].data); return UA_Server_removeDataSetWriter(server, nodeToRemove); } diff --git a/src/server/ua_server_async.c b/src/server/ua_server_async.c index c75b3c1ed57..24e3b30a35c 100644 --- a/src/server/ua_server_async.c +++ b/src/server/ua_server_async.c @@ -100,7 +100,6 @@ static UA_UInt32 processAsyncResults(UA_Server *server) { UA_AsyncManager *am = &server->asyncManager; UA_LOCK_ASSERT(&server->serviceMutex, 1); - UA_LOCK_ASSERT(&am->queueLock, 0); UA_UInt32 count = 0; UA_AsyncOperation *ao; diff --git a/src/server/ua_server_ns0_diagnostics.c b/src/server/ua_server_ns0_diagnostics.c index 9d243e146fc..a7c057fbb6e 100644 --- a/src/server/ua_server_ns0_diagnostics.c +++ b/src/server/ua_server_ns0_diagnostics.c @@ -74,8 +74,6 @@ readSubscriptionDiagnostics(UA_Server *server, const UA_NodeId *nodeId, void *nodeContext, UA_Boolean sourceTimestamp, const UA_NumericRange *range, UA_DataValue *value) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - /* Check the Subscription pointer */ UA_Subscription *sub = (UA_Subscription*)nodeContext; if(!sub) @@ -310,8 +308,6 @@ readSessionDiagnosticsArray(UA_Server *server, const UA_NodeId *nodeId, void *nodeContext, UA_Boolean sourceTimestamp, const UA_NumericRange *range, UA_DataValue *value) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - /* Allocate the output array */ UA_SessionDiagnosticsDataType *sd = (UA_SessionDiagnosticsDataType*) UA_Array_new(server->sessionCount, diff --git a/src/server/ua_subscription_alarms_conditions.c b/src/server/ua_subscription_alarms_conditions.c index 5d735aa8054..ab1e2df022d 100644 --- a/src/server/ua_subscription_alarms_conditions.c +++ b/src/server/ua_subscription_alarms_conditions.c @@ -248,7 +248,6 @@ UA_Server_setConditionTwoStateVariableCallback(UA_Server *server, const UA_NodeI const UA_NodeId conditionSource, UA_Boolean removeBranch, UA_TwoStateVariableChangeCallback callback, UA_TwoStateVariableCallbackType callbackType) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); /* Get Condition */ @@ -500,7 +499,6 @@ UA_Server_getNodeIdValueOfConditionField(UA_Server *server, const UA_NodeId *con static UA_StatusCode UA_Server_getConditionBranchNodeId(UA_Server *server, const UA_ByteString *eventId, UA_NodeId *outConditionBranchNodeId) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); *outConditionBranchNodeId = UA_NODEID_NULL; @@ -541,7 +539,6 @@ static UA_StatusCode UA_Server_getConditionLastSeverity(UA_Server *server, const UA_NodeId *conditionSource, const UA_NodeId *conditionId, UA_UInt16 *outLastSeverity, UA_DateTime *outLastSeveritySourceTimeStamp) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_Condition *cond = getCondition(server, conditionSource, conditionId); if(!cond) { @@ -560,7 +557,6 @@ static UA_StatusCode UA_Server_updateConditionLastSeverity(UA_Server *server, const UA_NodeId *conditionSource, const UA_NodeId *conditionId, UA_UInt16 lastSeverity, UA_DateTime lastSeveritySourceTimeStamp) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_Condition *cond = getCondition(server, conditionSource, conditionId); if(!cond) { @@ -579,7 +575,6 @@ static UA_StatusCode UA_Server_getConditionActiveState(UA_Server *server, const UA_NodeId *conditionSource, const UA_NodeId *conditionId, UA_ActiveState *outLastActiveState, UA_ActiveState *outCurrentActiveState, UA_Boolean *outIsLimitAlarm) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_Condition *cond = getCondition(server, conditionSource, conditionId); if(!cond) { @@ -599,7 +594,6 @@ static UA_StatusCode UA_Server_updateConditionActiveState(UA_Server *server, const UA_NodeId *conditionSource, const UA_NodeId *conditionId, const UA_ActiveState lastActiveState, const UA_ActiveState currentActiveState, UA_Boolean isLimitAlarm) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_Condition *cond = getCondition(server, conditionSource, conditionId); if(!cond) { @@ -905,8 +899,6 @@ afterWriteCallbackEnabledStateChange(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, const UA_NumericRange *range, const UA_DataValue *data) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - /* Callback for change in EnabledState/Id property. * First we get the EnabledState NodeId then The Condition NodeId */ UA_NodeId twoStateVariableNode; @@ -955,8 +947,6 @@ afterWriteCallbackAckedStateChange(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, const UA_NumericRange *range, const UA_DataValue *data) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - /* Get the AckedState NodeId then The Condition NodeId */ UA_NodeId twoStateVariableNode; UA_StatusCode retval = UA_Server_getFieldParentNodeId(server, nodeId, &twoStateVariableNode); @@ -1050,8 +1040,6 @@ afterWriteCallbackConfirmedStateChange(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, const UA_NumericRange *range, const UA_DataValue *data) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_Variant value; UA_NodeId twoStateVariableNode; UA_StatusCode retval = UA_Server_getFieldParentNodeId(server, nodeId, &twoStateVariableNode); @@ -1145,8 +1133,6 @@ afterWriteCallbackActiveStateChange(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, const UA_NumericRange *range, const UA_DataValue *data) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_Variant value; UA_NodeId twoStateVariableNode; UA_StatusCode retval = UA_Server_getFieldParentNodeId(server, nodeId, &twoStateVariableNode); @@ -1292,8 +1278,6 @@ afterWriteCallbackSeverityChange(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, const UA_NumericRange *range, const UA_DataValue *data) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_QualifiedName fieldLastSeverity = UA_QUALIFIEDNAME(0, CONDITION_FIELD_LASTSEVERITY); UA_QualifiedName fieldSourceTimeStamp = UA_QUALIFIEDNAME(0, CONDITION_FIELD_CONDITIONVARIABLE_SOURCETIMESTAMP); @@ -1383,8 +1367,6 @@ disableMethodCallback(UA_Server *server, const UA_NodeId *sessionId, void *methodContext, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_NodeId conditionTypeNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_CONDITIONTYPE); if(UA_NodeId_equal(objectId, &conditionTypeNodeId)) { UA_LOG_WARNING(server->config.logging, UA_LOGCATEGORY_USERLAND, @@ -1416,8 +1398,6 @@ enableMethodCallback(UA_Server *server, const UA_NodeId *sessionId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_NodeId conditionTypeNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_CONDITIONTYPE); if(UA_NodeId_equal(objectId, &conditionTypeNodeId)) { UA_LOG_WARNING(server->config.logging, UA_LOGCATEGORY_USERLAND, @@ -1449,8 +1429,6 @@ addCommentMethodCallback(UA_Server *server, const UA_NodeId *sessionId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_QualifiedName fieldComment = UA_QUALIFIEDNAME(0, CONDITION_FIELD_COMMENT); UA_QualifiedName fieldSourceTimeStamp = UA_QUALIFIEDNAME(0, CONDITION_FIELD_CONDITIONVARIABLE_SOURCETIMESTAMP); @@ -1537,8 +1515,6 @@ acknowledgeMethodCallback(UA_Server *server, const UA_NodeId *sessionId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_QualifiedName fieldComment = UA_QUALIFIEDNAME(0, CONDITION_FIELD_COMMENT); UA_Variant value; @@ -1619,8 +1595,6 @@ confirmMethodCallback(UA_Server *server, const UA_NodeId *sessionId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_QualifiedName fieldComment = UA_QUALIFIEDNAME(0, CONDITION_FIELD_COMMENT); UA_Variant value; @@ -1859,7 +1833,6 @@ refresh2MethodCallback(UA_Server *server, const UA_NodeId *sessionId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); //TODO implement logic for subscription array /* Check if valid subscriptionId */ @@ -1903,7 +1876,6 @@ refreshMethodCallback(UA_Server *server, const UA_NodeId *sessionId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); //TODO implement logic for subscription array @@ -2555,8 +2527,6 @@ UA_Server_createCondition(UA_Server *server, const UA_NodeId conditionSource, const UA_NodeId hierarchialReferenceType, UA_NodeId *outNodeId) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - if(!outNodeId) { UA_LOG_ERROR(server->config.logging, UA_LOGCATEGORY_USERLAND, "outNodeId cannot be NULL!"); @@ -2579,8 +2549,6 @@ UA_StatusCode UA_Server_addCondition_begin(UA_Server *server, const UA_NodeId conditionId, const UA_NodeId conditionType, const UA_QualifiedName conditionName, UA_NodeId *outNodeId) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - if(!outNodeId) { UA_LOG_ERROR(server->config.logging, UA_LOGCATEGORY_USERLAND, "outNodeId cannot be NULL!"); @@ -2616,7 +2584,6 @@ UA_StatusCode UA_Server_addCondition_finish(UA_Server *server, const UA_NodeId conditionId, const UA_NodeId conditionSource, const UA_NodeId hierarchialReferenceType) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); const UA_Node *node = UA_NODESTORE_GET(server, &conditionId); @@ -2806,7 +2773,6 @@ UA_StatusCode UA_Server_addConditionOptionalField(UA_Server *server, const UA_NodeId condition, const UA_NodeId conditionType, const UA_QualifiedName fieldName, UA_NodeId *outOptionalNode) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_StatusCode res = addConditionOptionalField(server, condition, conditionType, fieldName, outOptionalNode); @@ -2840,7 +2806,6 @@ setConditionField(UA_Server *server, const UA_NodeId condition, UA_StatusCode UA_Server_setConditionField(UA_Server *server, const UA_NodeId condition, const UA_Variant* value, const UA_QualifiedName fieldName) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_StatusCode retval = setConditionField(server, condition, value, fieldName); UA_UNLOCK(&server->serviceMutex); @@ -2888,7 +2853,6 @@ UA_Server_setConditionVariableFieldProperty(UA_Server *server, const UA_NodeId c const UA_Variant* value, const UA_QualifiedName variableFieldName, const UA_QualifiedName variablePropertyName) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_StatusCode res = setConditionVariableFieldProperty(server, condition, value, variableFieldName, variablePropertyName); @@ -2937,7 +2901,6 @@ triggerConditionEvent(UA_Server *server, const UA_NodeId condition, UA_StatusCode UA_Server_triggerConditionEvent(UA_Server *server, const UA_NodeId condition, const UA_NodeId conditionSource, UA_ByteString *outEventId) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); UA_LOCK(&server->serviceMutex); UA_StatusCode res = triggerConditionEvent(server, condition, conditionSource, outEventId); UA_UNLOCK(&server->serviceMutex); @@ -2947,8 +2910,6 @@ UA_Server_triggerConditionEvent(UA_Server *server, const UA_NodeId condition, UA_StatusCode UA_Server_deleteCondition(UA_Server *server, const UA_NodeId condition, const UA_NodeId conditionSource) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - /* Get ConditionSource Entry */ UA_Boolean found = false; /* Delete from internal list */ UA_ConditionSource *source, *tmp_source; @@ -3135,8 +3096,6 @@ UA_Server_setLimitState(UA_Server *server, const UA_NodeId conditionId, UA_StatusCode UA_Server_setExpirationDate(UA_Server *server, const UA_NodeId conditionId, UA_ByteString cert) { - UA_LOCK_ASSERT(&server->serviceMutex, 0); - UA_StatusCode retval; if(cert.data == NULL){ UA_LOG_ERROR(server->config.logging, UA_LOGCATEGORY_SERVER,