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
106
107
108
109
110
111
112
113
114
115
121
122
123
124
125
126
127
128
129
130
131
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
153
154
155
156
157
158
159
160
161
162
164
165
166
167
168
169
170
171
172
173
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
...
...
...
#define TX_SOURCE_CODE
#include "tx_api.h"
#include "tx_trace.h"
#include "tx_thread.h"
#include "tx_byte_pool.h"
...
...
UINT _tx_byte_pool_delete(TX_BYTE_POOL *pool_ptr)
{
TX_INTERRUPT_SAVE_AREA
TX_THREAD *thread_ptr;
TX_THREAD *next_thread;
UINT suspended_count;
TX_BYTE_POOL *next_pool;
TX_BYTE_POOL *previous_pool;
TX_DISABLE
TX_TRACE_IN_LINE_INSERT(TX_TRACE_BYTE_POOL_DELETE, pool_ptr, TX_POINTER_TO_ULONG_CONVERT(&thread_ptr), 0, 0, TX_TRACE_BYTE_POOL_EVENTS)
TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr)
TX_TRACE_OBJECT_UNREGISTER(pool_ptr)
TX_EL_BYTE_POOL_DELETE_INSERT
pool_ptr -> tx_byte_pool_id = TX_CLEAR_ID;
_tx_byte_pool_created_count--;
if (_tx_byte_pool_created_count == TX_EMPTY)
{
_tx_byte_pool_created_ptr = TX_NULL;
}if (_tx_byte_pool_created_count == TX_EMPTY) { ... }
else
{
next_pool = pool_ptr -> tx_byte_pool_created_next;
previous_pool = pool_ptr -> tx_byte_pool_created_previous;
next_pool -> tx_byte_pool_created_previous = previous_pool;
previous_pool -> tx_byte_pool_created_next = next_pool;
if (_tx_byte_pool_created_ptr == pool_ptr)
{
_tx_byte_pool_created_ptr = next_pool;
}if (_tx_byte_pool_created_ptr == pool_ptr) { ... }
}else { ... }
_tx_thread_preempt_disable++;
thread_ptr = pool_ptr -> tx_byte_pool_suspension_list;
pool_ptr -> tx_byte_pool_suspension_list = TX_NULL;
suspended_count = pool_ptr -> tx_byte_pool_suspended_count;
pool_ptr -> tx_byte_pool_suspended_count = TX_NO_SUSPENSIONS;
TX_RESTORE
/* ... */
while (suspended_count != TX_NO_SUSPENSIONS)
{
suspended_count--;
TX_DISABLE
/* ... */
thread_ptr -> tx_thread_suspend_cleanup = TX_NULL;
thread_ptr -> tx_thread_suspend_status = TX_DELETED;
next_thread = thread_ptr -> tx_thread_suspended_next;
#ifdef TX_NOT_INTERRUPTABLE
_tx_thread_system_ni_resume(thread_ptr);
TX_RESTORE/* ... */
#else
_tx_thread_preempt_disable++;
TX_RESTORE
_tx_thread_system_resume(thread_ptr);/* ... */
#endif
thread_ptr = next_thread;
}while (suspended_count != TX_NO_SUSPENSIONS) { ... }
TX_BYTE_POOL_DELETE_PORT_COMPLETION(pool_ptr)
TX_DISABLE
_tx_thread_preempt_disable--;
TX_RESTORE
_tx_thread_system_preempt_check();
return(TX_SUCCESS);
}{ ... }