urtware / doc / activitydiagrams / core / urtCoreStopNodes.uml @ dd31cb03
History | View | Annotate | Download (2.38 KB)
1 | e48e1ccf | Thomas Schöpping | /' |
---|---|---|---|
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**\nurtCoreStopNodes()\n |
||
27 | |||
28 | /'### PARAMETERS & RETURN ####################################################'/ |
||
29 | |||
30 | note |
||
31 | e87bd7c7 | Thomas Schöpping | -- **reason** : urt_status_t -- |
32 | The reason why the function was called. |
||
33 | For normal shutdown ""URT_STATUS_OK"" should be used. |
||
34 | e48e1ccf | Thomas Schöpping | ==== |
35 | -- **return** : urt_status_t -- |
||
36 | dd31cb03 | Thomas Schöpping | Returns ""URT_STATUS_OK"" if there was no call with another reason than ""URT_STATUS_OK"" before. |
37 | If the function has been called before with a different reason, that reason is returned. |
||
38 | e48e1ccf | Thomas Schöpping | endnote |
39 | |||
40 | /'### PROCEDURE ##############################################################'/ |
||
41 | |||
42 | start |
||
43 | e87bd7c7 | Thomas Schöpping | :lock core; |
44 | dd31cb03 | Thomas Schöpping | if (Current core ""_status"" value is ""URT_STATUS_OK""?) then (yes) |
45 | if (Thread priority is lower than ""URT_THREAD_PRIO_HIGH_MAX""?) then (yes) |
||
46 | :boost thread priority to ""URT_THREAD_PRIO_HIGH_MAX""; |
||
47 | else (no) |
||
48 | endif |
||
49 | :set core's ""_status"" variable to argument; |
||
50 | :access first node in core's list of nodes; |
||
51 | while (Current node is not ""NULL""?) is (yes) |
||
52 | :request node to terminate; |
||
53 | :proceed to next node; |
||
54 | endwhile (no) |
||
55 | :broadcast control event (terminate); |
||
56 | :unlock core; |
||
57 | if (Thread boosted its priority?) then (yes) |
||
58 | :reset thread priority; |
||
59 | else (no) |
||
60 | endif |
||
61 | stop |
||
62 | note |
||
63 | Returns ""URT_STATUS_OK"". |
||
64 | endnote |
||
65 | e87bd7c7 | Thomas Schöpping | else (no) |
66 | dd31cb03 | Thomas Schöpping | :unlock core; |
67 | stop |
||
68 | note |
||
69 | Returns the previously set ""_status"" value. |
||
70 | endnote |
||
71 | e87bd7c7 | Thomas Schöpping | endif |
72 | e48e1ccf | Thomas Schöpping | |
73 | /'### OUTRO ##################################################################'/ |
||
74 | |||
75 | @enduml |