Revision e87bd7c7 doc/activitydiagrams/node/_main.uml
| doc/activitydiagrams/node/_main.uml | ||
|---|---|---|
| 29 | 29 |
|
| 30 | 30 |
note |
| 31 | 31 |
-- **arg** : void* -- |
| 32 |
Optional Argument to the thread main function. |
|
| 32 |
Optional Argument to the thread main function (see ""urt_osThreadFunction_t""). |
|
| 33 |
This functions expects no arguments. |
|
| 33 | 34 |
==== |
| 34 | 35 |
-- **return** : void -- |
| 35 | 36 |
endnote |
| ... | ... | |
| 37 | 38 |
/'### PROCEDURE ##############################################################'/ |
| 38 | 39 |
|
| 39 | 40 |
start |
| 41 |
partition "setup" {
|
|
| 42 |
:register to core event; |
|
| 43 |
if (Node's ""setupcallback"" is set?) then (yes) |
|
| 44 |
:execute ""setupcallback()""; |
|
| 45 |
note |
|
| 46 |
Callback must not loop. |
|
| 47 |
endnote |
|
| 48 |
if (Event mask returned by ""setupcallback()"" redefines core event?) then (yes) |
|
| 49 |
:call ""urtCoreStopNodes(URT_STATUS_ERROR)""; |
|
| 50 |
else (no) |
|
| 51 |
endif |
|
| 52 |
else (no) |
|
| 53 |
:act as if ""stupcallback"" returned 0xF..F; |
|
| 54 |
endif |
|
| 55 |
if (Core status is ""URT_STATUS_OK""?) then (yes) |
|
| 56 |
:suspend all child threads (recursively); |
|
| 57 |
:synchronize by calling ""urtCoreSynchronizeNodes(1)""; |
|
| 58 |
:resume all child threads (recursively); |
|
| 59 |
else (no) |
|
| 60 |
endif |
|
| 61 |
} |
|
| 62 |
partition "loop" {
|
|
| 63 |
while (Thread termination requested?) is (no) |
|
| 64 |
:Wait for a specified or a core event; |
|
| 65 |
if (Core event received?) then (yes) |
|
| 66 |
else (no) |
|
| 67 |
:execute ""loopcallback()""; |
|
| 68 |
note |
|
| 69 |
Callback must not loop. |
|
| 70 |
endnote |
|
| 71 |
if (Event mask returned by ""loopcallback()"" redefines core event?) then (yes) |
|
| 72 |
:call ""urtCoreStopNodes(URT_STATUS_ERROR)""; |
|
| 73 |
else (no) |
|
| 74 |
endif |
|
| 75 |
endif |
|
| 76 |
endwhile |
|
| 77 |
} |
|
| 78 |
partition "outro" {
|
|
| 79 |
if (Node's ""shutdowncallback"" is set?) then (yes) |
|
| 80 |
:execute ""shutdowncallback()"" with core's status as argument; |
|
| 81 |
else (no) |
|
| 82 |
endif |
|
| 83 |
:unregister from core event; |
|
| 84 |
:terminate node thread (and all child threads); |
|
| 85 |
} |
|
| 40 | 86 |
stop |
| 41 | 87 |
|
| 42 | 88 |
/'### OUTRO ##################################################################'/ |
| 43 | 89 |
|
| 44 | 90 |
@enduml |
| 91 |
|
|
Also available in: Unified diff