reenable recursive resource_mutex
[nobug.git] / tests / 35resourcethreaded.tests
blobd7821f459d130fa6207fbe985a080dfc1193f0a8
2 TESTING "resource tracker, w/ threads" ./test_nobug_resources_threaded_mt_alpha
5 TEST "resource threaded, state assert, waiting ok" resourcethreaded_assert_state_waiting_ok <<END
6 err: ECHO:
7 err: RESOURCE_ANNOUNCE:
8 err: RESOURCE_ENTER:
9 err: RESOURCE_LEAVE: .*: type: test@.*: main: waiting
10 err: RESOURCE_FORGET:
11 END
14 TEST "resource threaded, state assert, exclusive fail" resourcethreaded_assert_state_exclusive_fail <<END
15 err: ECHO:
16 err: RESOURCE_ANNOUNCE:
17 err: RESOURCE_ENTER:
18 err: RESOURCE_ASSERT_STATE: .*: resource .* has state waiting but exclusive was expected
19 err: RESOURCE_DUMP:
20 err: BACKTRACE:|.*
21 return: !0
22 END
25 TEST "resource threaded, illegal threadid change, multithreading/alpha" resourcethreaded_ilg_threadid <<END
26 err: ECHO: .*: testing
27 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
28 err: ECHO: .*: main_1: main: create thread
29 err: ECHO: .*: thread_2: bugfn: thread startup, attach resource
30 err: RESOURCE_ENTER: .*: thread_2: bugfn: type: test@
31 err: ECHO: .*: thread_2: bugfn: changing id
32 err: NOBUG: .*: changing thread_id while resources are in use
33 return: !0
34 END
37 TEST "resource threaded, waiting/waiting, multithreading/alpha" resourcethreaded_waiting_waiting <<END
38 err: ECHO:
39 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
40 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: waiting
41 err: ECHO: .*: main_1: main: create thread
42 err: ECHO: .*: thread_2: threadfn: thread startup
43 err: ECHO: .*: thread_2: threadfn: enter direct
44 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
45 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: waiting
46 err: ECHO: .*: thread_2: threadfn: thread finished
47 err: ECHO: .*: main_1: main: thread joined
48 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: waiting
49 err: RESOURCE_FORGET: .*: main_1: main: type: test@
50 END
53 TEST "resource threaded, waiting/exclusive, multithreading/alpha" resourcethreaded_waiting_exclusive <<END
54 err: ECHO:
55 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
56 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: waiting
57 err: ECHO: .*: main_1: main: create thread
58 err: ECHO: .*: thread_2: threadfn: thread startup
59 err: ECHO: .*: thread_2: threadfn: enter via wait
60 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
61 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->exclusive
62 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: exclusive
63 err: ECHO: .*: thread_2: threadfn: thread finished
64 err: ECHO: .*: main_1: main: thread joined
65 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: waiting
66 err: RESOURCE_FORGET: .*: main_1: main: type: test@
67 END
70 TEST "resource threaded, waiting/recursive, multithreading/alpha" resourcethreaded_waiting_recursive <<END
71 err: ECHO:
72 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
73 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: waiting
74 err: ECHO: .*: main_1: main: create thread
75 err: ECHO: .*: thread_2: threadfn: thread startup
76 err: ECHO: .*: thread_2: threadfn: enter via wait
77 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
78 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->recursive
79 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: recursive
80 err: ECHO: .*: thread_2: threadfn: thread finished
81 err: ECHO: .*: main_1: main: thread joined
82 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: waiting
83 err: RESOURCE_FORGET: .*: main_1: main: type: test@
84 END
87 TEST "resource threaded, waiting/shared, multithreading/alpha" resourcethreaded_waiting_shared <<END
88 err: ECHO:
89 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
90 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: waiting
91 err: ECHO: .*: main_1: main: create thread
92 err: ECHO: .*: thread_2: threadfn: thread startup
93 err: ECHO: .*: thread_2: threadfn: enter via wait
94 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
95 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->shared
96 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: shared
97 err: ECHO: .*: thread_2: threadfn: thread finished
98 err: ECHO: .*: main_1: main: thread joined
99 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: waiting
100 err: RESOURCE_FORGET: .*: main_1: main: type: test@
104 TEST "resource threaded, exclusive/waiting, multithreading/alpha" resourcethreaded_exclusive_waiting <<END
105 err: ECHO:
106 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
107 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: exclusive
108 err: ECHO: .*: main_1: main: create thread
109 err: ECHO: .*: thread_2: threadfn: thread startup
110 err: ECHO: .*: thread_2: threadfn: enter direct
111 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
112 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: waiting
113 err: ECHO: .*: thread_2: threadfn: thread finished
114 err: ECHO: .*: main_1: main: thread joined
115 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: exclusive
116 err: RESOURCE_FORGET: .*: main_1: main: type: test@
120 TEST "resource threaded, exclusive/exclusive, multithreading/alpha" resourcethreaded_exclusive_exclusive <<END
121 err: ECHO:
122 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
123 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: exclusive
124 err: ECHO: .*: main_1: main: create thread
125 err: ECHO: .*: thread_2: threadfn: thread startup
126 err: ECHO: .*: thread_2: threadfn: enter via wait
127 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
128 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->exclusive
129 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->exclusive: resource hold by another thread
130 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
131 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
132 err: RESOURCE_DUMP: .*:        .*: main main_1:.* exclusive
133 err: BACKTRACE:|.*
134 return: !0
138 TEST "resource threaded, exclusive/recursive, multithreading/alpha" resourcethreaded_exclusive_recursive <<END
139 err: ECHO:
140 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
141 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: exclusive
142 err: ECHO: .*: main_1: main: create thread
143 err: ECHO: .*: thread_2: threadfn: thread startup
144 err: ECHO: .*: thread_2: threadfn: enter via wait
145 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
146 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->recursive
147 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->recursive: resource hold by another thread
148 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
149 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
150 err: RESOURCE_DUMP: .*:        .*: main main_1:.* exclusive
151 err: BACKTRACE:|.*
152 return: !0
156 TEST "resource threaded, exclusive/shared, multithreading/alpha" resourcethreaded_exclusive_shared <<END
157 err: ECHO:
158 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
159 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: exclusive
160 err: ECHO: .*: main_1: main: create thread
161 err: ECHO: .*: thread_2: threadfn: thread startup
162 err: ECHO: .*: thread_2: threadfn: enter via wait
163 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
164 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->shared
165 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->shared: resource hold by another thread nonshared
166 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
167 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
168 err: RESOURCE_DUMP: .*:        .*: main main_1:.* exclusive
169 err: BACKTRACE:|.*
170 return: !0
174 TEST "resource threaded, recursive/waiting, multithreading/alpha" resourcethreaded_recursive_waiting <<END
175 err: ECHO:
176 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
177 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: recursive
178 err: ECHO: .*: main_1: main: create thread
179 err: ECHO: .*: thread_2: threadfn: thread startup
180 err: ECHO: .*: thread_2: threadfn: enter direct
181 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
182 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: waiting
183 err: ECHO: .*: thread_2: threadfn: thread finished
184 err: ECHO: .*: main_1: main: thread joined
185 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: recursive
186 err: RESOURCE_FORGET: .*: main_1: main: type: test@
190 TEST "resource threaded, recursive/exclusive, multithreading/alpha" resourcethreaded_recursive_exclusive <<END
191 err: ECHO:
192 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
193 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: recursive
194 err: ECHO: .*: main_1: main: create thread
195 err: ECHO: .*: thread_2: threadfn: thread startup
196 err: ECHO: .*: thread_2: threadfn: enter via wait
197 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
198 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->exclusive
199 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->exclusive: resource hold by another thread
200 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
201 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
202 err: RESOURCE_DUMP: .*:        .*: main main_1:.* recursive
203 err: BACKTRACE:|.*
204 return: !0
208 TEST "resource threaded, recursive/recursive, multithreading/alpha" resourcethreaded_recursive_recursive <<END
209 err: ECHO:
210 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
211 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: recursive
212 err: ECHO: .*: main_1: main: create thread
213 err: ECHO: .*: thread_2: threadfn: thread startup
214 err: ECHO: .*: thread_2: threadfn: enter via wait
215 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
216 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->recursive
217 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->recursive: resource hold by another thread
218 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
219 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
220 err: RESOURCE_DUMP: .*:        .*: main main_1:.* recursive
221 err: BACKTRACE:|.*
222 return: !0
226 TEST "resource threaded, recursive/shared, multithreading/alpha" resourcethreaded_recursive_shared <<END
227 err: ECHO:
228 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
229 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: recursive
230 err: ECHO: .*: main_1: main: create thread
231 err: ECHO: .*: thread_2: threadfn: thread startup
232 err: ECHO: .*: thread_2: threadfn: enter via wait
233 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
234 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->shared
235 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->shared: resource hold by another thread nonshared
236 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
237 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
238 err: RESOURCE_DUMP: .*:        .*: main main_1:.* recursive
239 err: BACKTRACE:|.*
240 return: !0
244 TEST "resource threaded, shared/waiting, multithreading/alpha" resourcethreaded_shared_waiting <<END
245 err: ECHO:
246 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
247 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: shared
248 err: ECHO: .*: main_1: main: create thread
249 err: ECHO: .*: thread_2: threadfn: thread startup
250 err: ECHO: .*: thread_2: threadfn: enter direct
251 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
252 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: waiting
253 err: ECHO: .*: thread_2: threadfn: thread finished
254 err: ECHO: .*: main_1: main: thread joined
255 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: shared
256 err: RESOURCE_FORGET: .*: main_1: main: type: test@
260 TEST "resource threaded, shared/exclusive, multithreading/alpha" resourcethreaded_shared_exclusive <<END
261 err: ECHO:
262 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
263 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: shared
264 err: ECHO: .*: main_1: main: create thread
265 err: ECHO: .*: thread_2: threadfn: thread startup
266 err: ECHO: .*: thread_2: threadfn: enter via wait
267 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
268 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->exclusive
269 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->exclusive: resource hold by another thread
270 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
271 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
272 err: RESOURCE_DUMP: .*:        .*: main main_1:.* shared
273 err: BACKTRACE:|.*
274 return: !0
278 TEST "resource threaded, shared/recursive, multithreading/alpha" resourcethreaded_shared_recursive <<END
279 err: ECHO:
280 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
281 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: shared
282 err: ECHO: .*: main_1: main: create thread
283 err: ECHO: .*: thread_2: threadfn: thread startup
284 err: ECHO: .*: thread_2: threadfn: enter via wait
285 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
286 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->recursive
287 err: RESOURCE_ASSERT_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->recursive: resource hold by another thread
288 err: RESOURCE_DUMP: .*: thread_2: threadfn: .* type:test: hold by 2 entities:
289 err: RESOURCE_DUMP: .*:        .*: thread thread_2:.* waiting
290 err: RESOURCE_DUMP: .*:        .*: main main_1:.* shared
291 err: BACKTRACE:|.*
292 return: !0
296 TEST "resource threaded, shared/shared, multithreading/alpha" resourcethreaded_shared_shared <<END
297 err: ECHO:
298 err: RESOURCE_ANNOUNCE: .*: main_1: main: type: test@
299 err: RESOURCE_ENTER: .*: main_1: main: type: test@.*: main: shared
300 err: ECHO: .*: main_1: main: create thread
301 err: ECHO: .*: thread_2: threadfn: thread startup
302 err: ECHO: .*: thread_2: threadfn: enter via wait
303 err: RESOURCE_ENTER: .*: thread_2: threadfn: type: test@.*: thread: waiting
304 err: RESOURCE_STATE: .*: thread_2: threadfn: type: test@.*: thread: waiting->shared
305 err: RESOURCE_LEAVE: .*: thread_2: threadfn: type: test@.*: thread: shared
306 err: ECHO: .*: thread_2: threadfn: thread finished
307 err: ECHO: .*: main_1: main: thread joined
308 err: RESOURCE_LEAVE: .*: main_1: main: type: test@.*: main: shared
309 err: RESOURCE_FORGET: .*: main_1: main: type: test@