소스 검색

fix: remove a warning from clang-analyzer; fix rcu locking

Julius Pfrommer 8 년 전
부모
커밋
327c32d62e
2개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/server/ua_server.c
  2. 1 0
      src/server/ua_server_worker.c

+ 2 - 0
src/server/ua_server.c

@@ -174,6 +174,7 @@ addNodeInternalWithType(UA_Server *server, UA_Node *node, const UA_NodeId parent
 
 // delete any children of an instance without touching the object itself
 static void deleteInstanceChildren(UA_Server *server, UA_NodeId *objectNodeId) {
+    UA_RCU_LOCK();
   UA_BrowseDescription bDes;
   UA_BrowseDescription_init(&bDes);
   UA_NodeId_copy(objectNodeId, &bDes.nodeId );
@@ -203,6 +204,7 @@ static void deleteInstanceChildren(UA_Server *server, UA_NodeId *objectNodeId) {
     }
   }
   UA_BrowseResult_deleteMembers(&bRes); 
+  UA_RCU_UNLOCK();
 }
 
 /**********/

+ 1 - 0
src/server/ua_server_worker.c

@@ -278,6 +278,7 @@ processRepeatedJobs(UA_Server *server, UA_DateTime current) {
         if(last_dispatched->nextTime == rj->nextTime) {
             /* We "batch" repeatedJobs with the same interval in
              * addRepeatedJobs. So this might occur quite often. */
+            UA_assert(last_dispatched != &tmp_last);
             prev_rj = last_dispatched;
         } else {
             /* Find the position by a linear search starting at the first