Statistics
| Branch: | Revision:

urtware / doc / activitydiagrams / core / urtCoreSynchronizeNodes.uml @ dd31cb03

History | View | Annotate | Download (2.422 KB)

1
/'
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

    
6
Copyright (C) 2018..2020  Thomas Schöpping et al.
7

    
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

    
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

    
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
'/
21

    
22
/'### INTRO ##################################################################'/
23

    
24
@startuml
25

    
26
title **µRtWare**\nurtCoreSynchronizeNodes()\n
27

    
28
/'### PARAMETERS & RETURN ####################################################'/
29

    
30
note
31
  -- **node** : urt_node_t* --
32
  Pointer to a node to synchronize.
33
  Must not be ""NULL"".
34
  ====
35
  -- **return** : urt_status_t --
36
  Returns ""URT_STATUS_OK"" if all nodes are synchronized and proceed.
37
  Returns ""URT_STATUS_SYNC_ERROR"" if an exception occurred (faulty stage value detected).
38
  Returns ""URT_STATUS_SYNC_PENDING"" if there are nodes left to synchronize.
39
  In the latter case, the node thread must still wait for the control event (proceed) to synchronize.
40
endnote
41

    
42
/'### PROCEDURE ##############################################################'/
43

    
44
start
45
:lock core;
46
:increment the node's stage value;
47
:access first node core's list of nodes;
48
while (Current node is not ""NULL""\nand stage of current node is equal to argument?) is (yes)
49
  :proceed to next node;
50
endwhile (no)
51
if (All nodes are at the same stage?) then (yes)
52
  :broadcast control event (proceed);
53
  :unlock core;
54
  stop
55
  note
56
    Returns ""URT_STATUS_OK"".
57
  endnote
58
elseif (The stage of the last checked node was one less than the argument?) then (yes)
59
  :unlock core;
60
  stop
61
  note
62
    Returns a ""URT_STATUS_SYNC_PENDING"".
63
  endnote
64
else (no)
65
  :call ""urtCoreStopNodes(URT_STATUS_SYNC_ERROR)"";
66
  :unlock core;
67
  stop
68
  note
69
    Returns ""URT_STATUS_SYNC_ERROR"".
70
  endnote
71
endif
72

    
73
/'### OUTRO ##################################################################'/
74

    
75
@enduml