1
10
13
14
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
111
112
113
114
115
116
117
118
119
126
127
128
129
130
131
134
135
136
138
139
140
141
142
143
144
145
146
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
191
192
193
194
195
196
197
198
201
202
203
...
...
...
#define TX_SOURCE_CODE
#include "tx_api.h"
#include "tx_thread.h"
...
...
VOID _tx_thread_shell_entry(VOID)
{
TX_INTERRUPT_SAVE_AREA
TX_THREAD *thread_ptr;
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
VOID (*entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type);
#endif
TX_THREAD_GET_CURRENT(thread_ptr)
TX_THREAD_STARTED_EXTENSION(thread_ptr)
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
TX_DISABLE
entry_exit_notify = thread_ptr -> tx_thread_entry_exit_notify;
TX_RESTORE
if (entry_exit_notify != TX_NULL)
{
(entry_exit_notify)(thread_ptr, TX_THREAD_ENTRY);
}if (entry_exit_notify != TX_NULL) { ... }
/* ... */#endif
(thread_ptr -> tx_thread_entry) (thread_ptr -> tx_thread_entry_parameter);
if (_tx_thread_mutex_release != TX_NULL)
{
/* ... */
(_tx_thread_mutex_release)(thread_ptr);
}if (_tx_thread_mutex_release != TX_NULL) { ... }
TX_DISABLE
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
entry_exit_notify = thread_ptr -> tx_thread_entry_exit_notify;/* ... */
#endif
/* ... */
thread_ptr -> tx_thread_state = TX_COMPLETED;
TX_THREAD_STATE_CHANGE(thread_ptr, TX_COMPLETED)
#ifdef TX_NOT_INTERRUPTABLE
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
if (entry_exit_notify != TX_NULL)
{
(entry_exit_notify)(thread_ptr, TX_THREAD_EXIT);
}if (entry_exit_notify != TX_NULL) { ... }
/* ... */#endif
TX_THREAD_COMPLETED_EXTENSION(thread_ptr)
_tx_thread_system_ni_suspend(thread_ptr, ((ULONG) 0));
TX_RESTORE/* ... */
#else
thread_ptr -> tx_thread_suspending = TX_TRUE;
thread_ptr -> tx_thread_timer.tx_timer_internal_remaining_ticks = ((ULONG) 0);
_tx_thread_preempt_disable++;
TX_RESTORE
TX_THREAD_COMPLETED_EXTENSION(thread_ptr)
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
if (entry_exit_notify != TX_NULL)
{
(entry_exit_notify)(thread_ptr, TX_THREAD_EXIT);
}if (entry_exit_notify != TX_NULL) { ... }
/* ... */#endif
_tx_thread_system_suspend(thread_ptr);/* ... */
#endif
#ifdef TX_SAFETY_CRITICAL
TX_SAFETY_CRITICAL_EXCEPTION(__FILE__, __LINE__, 0);/* ... */
#endif
}{ ... }