summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-04-09 13:36:58 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-10 11:28:01 +0200
commitf810e0a3ba9401f0ca0bcb48270c1964322f9af0 (patch)
treecc4cbc1f50abe0d3eb69f0b2c7d5293b211445a2
parent0ea6624e10a4150893c7d80b3ce74b87875d33a6 (diff)
tests: improve ecore thread queue reliability
Summary: * check inside thread callbacks whether thread has been canceled * clean up (global) objects * wait for threads to die before exiting each test ref T6851 Depends on D5889 Reviewers: stefan_schmidt Subscribers: cedric Maniphest Tasks: T6851 Differential Revision: https://phab.enlightenment.org/D5890
-rw-r--r--src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c110
1 files changed, 68 insertions, 42 deletions
diff --git a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
index 9cfd283b9a..28f3010044 100644
--- a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
+++ b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
@@ -24,7 +24,7 @@ typedef struct
24} Msg; 24} Msg;
25 25
26static void 26static void
27th1_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 27th1_do(void *data EINA_UNUSED, Ecore_Thread *th)
28{ 28{
29 int val = 100; 29 int val = 100;
30 30
@@ -38,13 +38,13 @@ th1_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
38 msg->value = val; 38 msg->value = val;
39 memset(msg->pad, 0x32, 10); 39 memset(msg->pad, 0x32, 10);
40 eina_thread_queue_send_done(thq1, ref); 40 eina_thread_queue_send_done(thq1, ref);
41 if (val == 1000) break; 41 if (val == 1000 || (ecore_thread_check(th))) break;
42 val++; 42 val++;
43 } 43 }
44} 44}
45 45
46static void 46static void
47th2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 47th2_do(void *data EINA_UNUSED, Ecore_Thread *th)
48{ 48{
49 int val; 49 int val;
50 50
@@ -63,20 +63,21 @@ th2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
63 msg->value = val; 63 msg->value = val;
64 memset(msg->pad, 0x32, 10); 64 memset(msg->pad, 0x32, 10);
65 eina_thread_queue_send_done(thq2, ref); 65 eina_thread_queue_send_done(thq2, ref);
66 if (val == 1000) break; 66 if (val == 1000 || (ecore_thread_check(th))) break;
67 } 67 }
68} 68}
69 69
70EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1) 70EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
71{ 71{
72 int val = 99; 72 int val = 99;
73 Ecore_Thread *eth1, *eth2;
73 74
74 thq1 = eina_thread_queue_new(); 75 thq1 = eina_thread_queue_new();
75 if (!thq1) fail(); 76 if (!thq1) fail();
76 thq2 = eina_thread_queue_new(); 77 thq2 = eina_thread_queue_new();
77 if (!thq2) fail(); 78 if (!thq2) fail();
78 ecore_thread_feedback_run(th1_do, NULL, NULL, NULL, NULL, EINA_TRUE); 79 eth1 = ecore_thread_feedback_run(th1_do, NULL, NULL, NULL, NULL, EINA_TRUE);
79 ecore_thread_feedback_run(th2_do, NULL, NULL, NULL, NULL, EINA_TRUE); 80 eth2 = ecore_thread_feedback_run(th2_do, NULL, NULL, NULL, NULL, EINA_TRUE);
80 81
81 for (;;) 82 for (;;)
82 { 83 {
@@ -93,7 +94,10 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
93 eina_thread_queue_wait_done(thq2, ref); 94 eina_thread_queue_wait_done(thq2, ref);
94 if (val == 1000) break; 95 if (val == 1000) break;
95 } 96 }
96 97 ecore_thread_wait(eth1, 0.1);
98 ecore_thread_wait(eth2, 0.1);
99 eina_thread_queue_free(thq1);
100 eina_thread_queue_free(thq2);
97} 101}
98EFL_END_TEST 102EFL_END_TEST
99 103
@@ -107,7 +111,7 @@ typedef struct
107static volatile int msgs = 0; 111static volatile int msgs = 0;
108 112
109static void 113static void
110thspeed2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 114thspeed2_do(void *data EINA_UNUSED, Ecore_Thread *th)
111{ 115{
112 Msg2 *msg; 116 Msg2 *msg;
113 void *ref; 117 void *ref;
@@ -120,7 +124,7 @@ thspeed2_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
120 msgs++; 124 msgs++;
121 eina_thread_queue_wait_done(thq1, ref); 125 eina_thread_queue_wait_done(thq1, ref);
122 } 126 }
123 if (msgs == 1000) 127 if (msgs == 1000 || (ecore_thread_check(th)))
124 { 128 {
125 if (DEBUG) printf("msgs done\n"); 129 if (DEBUG) printf("msgs done\n");
126 break; 130 break;
@@ -152,7 +156,8 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t2)
152 ck_abort_msg("ERR: not enough messages recieved -> %i\n", mcount); 156 ck_abort_msg("ERR: not enough messages recieved -> %i\n", mcount);
153 } 157 }
154 if (DEBUG) printf("%i messages sent\n", i); 158 if (DEBUG) printf("%i messages sent\n", i);
155 159 ecore_thread_wait(th, 0.1);
160 eina_thread_queue_free(thq1);
156} 161}
157EFL_END_TEST 162EFL_END_TEST
158 163
@@ -164,7 +169,7 @@ typedef struct
164} Msg3; 169} Msg3;
165 170
166static void 171static void
167th31_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 172th31_do(void *data EINA_UNUSED, Ecore_Thread *th)
168{ 173{
169 int val = 100; 174 int val = 100;
170 175
@@ -178,12 +183,12 @@ th31_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
178 msg->value = val; 183 msg->value = val;
179 eina_thread_queue_send_done(thq1, ref); 184 eina_thread_queue_send_done(thq1, ref);
180 val++; 185 val++;
181 if (val == 1100) break; 186 if (val == 1100 || (ecore_thread_check(th))) break;
182 } 187 }
183} 188}
184 189
185static void 190static void
186th32_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 191th32_do(void *data EINA_UNUSED, Ecore_Thread *th)
187{ 192{
188 int val = 100; 193 int val = 100;
189 194
@@ -197,7 +202,7 @@ th32_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
197 msg->value = val; 202 msg->value = val;
198 eina_thread_queue_send_done(thq2, ref); 203 eina_thread_queue_send_done(thq2, ref);
199 val++; 204 val++;
200 if (val == 1100) break; 205 if (val == 1100 || (ecore_thread_check(th))) break;
201 } 206 }
202} 207}
203 208
@@ -205,6 +210,7 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
205{ 210{
206 int val1 = 99, val2 = 99, cnt = 0; 211 int val1 = 99, val2 = 99, cnt = 0;
207 Eina_Thread_Queue *parent; 212 Eina_Thread_Queue *parent;
213 Ecore_Thread *eth1, *eth2;
208 214
209 thq1 = eina_thread_queue_new(); 215 thq1 = eina_thread_queue_new();
210 if (!thq1) fail(); 216 if (!thq1) fail();
@@ -220,8 +226,8 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
220 parent = eina_thread_queue_parent_get(thq2); 226 parent = eina_thread_queue_parent_get(thq2);
221 fail_if(parent != thqmaster); 227 fail_if(parent != thqmaster);
222 228
223 ecore_thread_feedback_run(th31_do, NULL, NULL, NULL, NULL, EINA_TRUE); 229 eth1 = ecore_thread_feedback_run(th31_do, NULL, NULL, NULL, NULL, EINA_TRUE);
224 ecore_thread_feedback_run(th32_do, NULL, NULL, NULL, NULL, EINA_TRUE); 230 eth2 = ecore_thread_feedback_run(th32_do, NULL, NULL, NULL, NULL, EINA_TRUE);
225 for (;;) 231 for (;;)
226 { 232 {
227 Eina_Thread_Queue_Msg_Sub *sub; 233 Eina_Thread_Queue_Msg_Sub *sub;
@@ -260,7 +266,11 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
260 if (cnt == 2000) break; 266 if (cnt == 2000) break;
261 } 267 }
262 if (DEBUG) printf("enough msgs\n"); 268 if (DEBUG) printf("enough msgs\n");
263 269 ecore_thread_wait(eth1, 0.1);
270 ecore_thread_wait(eth2, 0.1);
271 eina_thread_queue_free(thq1);
272 eina_thread_queue_free(thq2);
273 eina_thread_queue_free(thqmaster);
264} 274}
265EFL_END_TEST 275EFL_END_TEST
266 276
@@ -272,7 +282,7 @@ typedef struct
272} Msg4; 282} Msg4;
273 283
274static void 284static void
275th41_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 285th41_do(void *data EINA_UNUSED, Ecore_Thread *th)
276{ 286{
277 int val = 100; 287 int val = 100;
278 288
@@ -285,12 +295,12 @@ th41_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
285 msg->value = val; 295 msg->value = val;
286 eina_thread_queue_send_done(thq1, ref); 296 eina_thread_queue_send_done(thq1, ref);
287 val++; 297 val++;
288 if (val == 1100) break; 298 if (val == 1100 || (ecore_thread_check(th))) break;
289 } 299 }
290} 300}
291 301
292static void 302static void
293th42_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 303th42_do(void *data EINA_UNUSED, Ecore_Thread *th)
294{ 304{
295 int val = 10000; 305 int val = 10000;
296 306
@@ -303,7 +313,7 @@ th42_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
303 msg->value = val; 313 msg->value = val;
304 eina_thread_queue_send_done(thq1, ref); 314 eina_thread_queue_send_done(thq1, ref);
305 val++; 315 val++;
306 if (val == 11000) break; 316 if (val == 11000 || (ecore_thread_check(th))) break;
307 } 317 }
308} 318}
309 319
@@ -312,10 +322,12 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
312{ 322{
313 int cnt = 0; 323 int cnt = 0;
314 int val1 = 99, val2 = 9999; 324 int val1 = 99, val2 = 9999;
325 Ecore_Thread *eth1, *eth2;
326
315 thq1 = eina_thread_queue_new(); 327 thq1 = eina_thread_queue_new();
316 if (!thq1) fail(); 328 if (!thq1) fail();
317 ecore_thread_feedback_run(th41_do, NULL, NULL, NULL, NULL, EINA_TRUE); 329 eth1 = ecore_thread_feedback_run(th41_do, NULL, NULL, NULL, NULL, EINA_TRUE);
318 ecore_thread_feedback_run(th42_do, NULL, NULL, NULL, NULL, EINA_TRUE); 330 eth2 = ecore_thread_feedback_run(th42_do, NULL, NULL, NULL, NULL, EINA_TRUE);
319 for (;;) 331 for (;;)
320 { 332 {
321 Msg4 *msg; 333 Msg4 *msg;
@@ -343,7 +355,9 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
343 if (cnt == 2000) break; 355 if (cnt == 2000) break;
344 } 356 }
345 if (DEBUG) printf("msgs ok\n"); 357 if (DEBUG) printf("msgs ok\n");
346 358 ecore_thread_wait(eth1, 0.1);
359 ecore_thread_wait(eth2, 0.1);
360 eina_thread_queue_free(thq1);
347} 361}
348EFL_END_TEST 362EFL_END_TEST
349 363
@@ -358,7 +372,7 @@ typedef struct
358static Eina_Semaphore th4_sem; 372static Eina_Semaphore th4_sem;
359 373
360static void 374static void
361th51_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 375th51_do(void *data EINA_UNUSED, Ecore_Thread *th)
362{ 376{
363 int val = 100; 377 int val = 100;
364 378
@@ -370,7 +384,7 @@ th51_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
370 msg = eina_thread_queue_send(thq1, sizeof(Msg5), &ref); 384 msg = eina_thread_queue_send(thq1, sizeof(Msg5), &ref);
371 msg->value = val; 385 msg->value = val;
372 eina_thread_queue_send_done(thq1, ref); 386 eina_thread_queue_send_done(thq1, ref);
373 if (val == 1100) break; 387 if (val == 1100 || (ecore_thread_check(th))) break;
374 val++; 388 val++;
375 } 389 }
376 390
@@ -378,7 +392,7 @@ th51_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
378} 392}
379 393
380static void 394static void
381th52_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 395th52_do(void *data EINA_UNUSED, Ecore_Thread *th)
382{ 396{
383 int val; 397 int val;
384 398
@@ -396,7 +410,7 @@ th52_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
396 if (!msg) fail(); 410 if (!msg) fail();
397 msg->value = val; 411 msg->value = val;
398 eina_thread_queue_send_done(thq2, ref); 412 eina_thread_queue_send_done(thq2, ref);
399 if (val == 1100) break; 413 if (val == 1100 || (ecore_thread_check(th))) break;
400 } 414 }
401 415
402 eina_semaphore_release(&th4_sem, 1); 416 eina_semaphore_release(&th4_sem, 1);
@@ -406,6 +420,7 @@ th52_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
406EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5) 420EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
407{ 421{
408 int val = 99; 422 int val = 99;
423 Ecore_Thread *eth1, *eth2;
409 424
410 eina_semaphore_new(&th4_sem, 0); 425 eina_semaphore_new(&th4_sem, 0);
411 426
@@ -413,8 +428,8 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
413 if (!thq1) fail(); 428 if (!thq1) fail();
414 thq2 = eina_thread_queue_new(); 429 thq2 = eina_thread_queue_new();
415 if (!thq2) fail(); 430 if (!thq2) fail();
416 ecore_thread_feedback_run(th51_do, NULL, NULL, NULL, NULL, EINA_TRUE); 431 eth1 = ecore_thread_feedback_run(th51_do, NULL, NULL, NULL, NULL, EINA_TRUE);
417 ecore_thread_feedback_run(th52_do, NULL, NULL, NULL, NULL, EINA_TRUE); 432 eth2 = ecore_thread_feedback_run(th52_do, NULL, NULL, NULL, NULL, EINA_TRUE);
418 433
419 for (;;) 434 for (;;)
420 { 435 {
@@ -442,6 +457,8 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
442 eina_semaphore_lock(&th4_sem); 457 eina_semaphore_lock(&th4_sem);
443 458
444 // All done! 459 // All done!
460 ecore_thread_wait(eth1, 0.1);
461 ecore_thread_wait(eth2, 0.1);
445 eina_semaphore_free(&th4_sem); 462 eina_semaphore_free(&th4_sem);
446 eina_thread_queue_free(thq1); 463 eina_thread_queue_free(thq1);
447 eina_thread_queue_free(thq2); 464 eina_thread_queue_free(thq2);
@@ -461,7 +478,7 @@ static Eina_Semaphore th6_sem;
461const int EXIT_MESSAGE = -42; 478const int EXIT_MESSAGE = -42;
462 479
463static void 480static void
464th61_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 481th61_do(void *data EINA_UNUSED, Ecore_Thread *th)
465{ 482{
466 int val = 100; 483 int val = 100;
467 484
@@ -474,6 +491,7 @@ th61_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
474 fail_if(!msg); 491 fail_if(!msg);
475 msg->value = val; 492 msg->value = val;
476 eina_thread_queue_send_done(thq1, ref); 493 eina_thread_queue_send_done(thq1, ref);
494 if (ecore_thread_check(th)) break;
477 } 495 }
478 496
479 eina_semaphore_release(&th6_sem, 1); 497 eina_semaphore_release(&th6_sem, 1);
@@ -481,7 +499,7 @@ th61_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
481} 499}
482 500
483static void 501static void
484th62_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 502th62_do(void *data EINA_UNUSED, Ecore_Thread *th)
485{ 503{
486 int cnt = 0; 504 int cnt = 0;
487 505
@@ -496,7 +514,7 @@ th62_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
496 if (DEBUG) printf("%s: v %08i: %i [%i]\n", __FUNCTION__, cnt, msg->value, eina_thread_queue_pending_get(thq1)); 514 if (DEBUG) printf("%s: v %08i: %i [%i]\n", __FUNCTION__, cnt, msg->value, eina_thread_queue_pending_get(thq1));
497 val = msg->value; 515 val = msg->value;
498 eina_thread_queue_wait_done(thq1, ref); 516 eina_thread_queue_wait_done(thq1, ref);
499 if (val == EXIT_MESSAGE) break; 517 if (val == EXIT_MESSAGE || (ecore_thread_check(th))) break;
500 cnt++; 518 cnt++;
501 eina_spinlock_take(&msgnum_lock); 519 eina_spinlock_take(&msgnum_lock);
502 msgnum++; 520 msgnum++;
@@ -511,7 +529,7 @@ th62_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
511} 529}
512 530
513static void 531static void
514th63_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 532th63_do(void *data EINA_UNUSED, Ecore_Thread *th)
515{ 533{
516 int cnt = 0; 534 int cnt = 0;
517 535
@@ -526,7 +544,7 @@ th63_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
526 if (DEBUG) printf("%s: v %08i: %i [%i]\n", __FUNCTION__, cnt, msg->value, eina_thread_queue_pending_get(thq1)); 544 if (DEBUG) printf("%s: v %08i: %i [%i]\n", __FUNCTION__, cnt, msg->value, eina_thread_queue_pending_get(thq1));
527 val = msg->value; 545 val = msg->value;
528 eina_thread_queue_wait_done(thq1, ref); 546 eina_thread_queue_wait_done(thq1, ref);
529 if (val == EXIT_MESSAGE) break; 547 if (val == EXIT_MESSAGE || (ecore_thread_check(th))) break;
530 cnt++; 548 cnt++;
531 eina_spinlock_take(&msgnum_lock); 549 eina_spinlock_take(&msgnum_lock);
532 msgnum++; 550 msgnum++;
@@ -542,10 +560,10 @@ th63_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
542 560
543EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6) 561EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
544{ 562{
545 Ecore_Thread *t1, *t2, *t3;
546 int do_break = 0; 563 int do_break = 0;
547 Msg6 *msg; 564 Msg6 *msg;
548 void *ref; 565 void *ref;
566 Ecore_Thread *eth1, *eth2, *eth3;
549 567
550 if (DEBUG) setbuf(stdout, NULL); 568 if (DEBUG) setbuf(stdout, NULL);
551 569
@@ -553,9 +571,9 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
553 eina_spinlock_new(&msgnum_lock); 571 eina_spinlock_new(&msgnum_lock);
554 thq1 = eina_thread_queue_new(); 572 thq1 = eina_thread_queue_new();
555 fail_if(!thq1); 573 fail_if(!thq1);
556 t1 = ecore_thread_feedback_run(th61_do, NULL, NULL, NULL, NULL, EINA_TRUE); 574 eth1 = ecore_thread_feedback_run(th61_do, NULL, NULL, NULL, NULL, EINA_TRUE);
557 t2 = ecore_thread_feedback_run(th62_do, NULL, NULL, NULL, NULL, EINA_TRUE); 575 eth2 = ecore_thread_feedback_run(th62_do, NULL, NULL, NULL, NULL, EINA_TRUE);
558 t3 = ecore_thread_feedback_run(th63_do, NULL, NULL, NULL, NULL, EINA_TRUE); 576 eth3 = ecore_thread_feedback_run(th63_do, NULL, NULL, NULL, NULL, EINA_TRUE);
559 577
560 // Spin until we reach 10000 messages sent 578 // Spin until we reach 10000 messages sent
561 while (!do_break) 579 while (!do_break)
@@ -582,6 +600,9 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
582 fail_if(!eina_semaphore_lock(&th6_sem)); 600 fail_if(!eina_semaphore_lock(&th6_sem));
583 601
584 // All done! 602 // All done!
603 ecore_thread_wait(eth1, 0.1);
604 ecore_thread_wait(eth2, 0.1);
605 ecore_thread_wait(eth3, 0.1);
585 eina_semaphore_free(&th6_sem); 606 eina_semaphore_free(&th6_sem);
586 eina_thread_queue_free(thq1); 607 eina_thread_queue_free(thq1);
587 eina_spinlock_free(&msgnum_lock); 608 eina_spinlock_free(&msgnum_lock);
@@ -599,7 +620,7 @@ typedef struct
599int p[2]; 620int p[2];
600 621
601static void 622static void
602thspeed7_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED) 623thspeed7_do(void *data EINA_UNUSED, Ecore_Thread *th)
603{ 624{
604 Msg7 *msg; 625 Msg7 *msg;
605 void *ref; 626 void *ref;
@@ -609,6 +630,7 @@ thspeed7_do(void *data EINA_UNUSED, Ecore_Thread *th EINA_UNUSED)
609 { 630 {
610 msg = eina_thread_queue_send(thq1, sizeof(Msg7), &ref); 631 msg = eina_thread_queue_send(thq1, sizeof(Msg7), &ref);
611 if (msg) eina_thread_queue_send_done(thq1, ref); 632 if (msg) eina_thread_queue_send_done(thq1, ref);
633 if (ecore_thread_check(th)) break;
612 } 634 }
613} 635}
614 636
@@ -617,6 +639,7 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
617 Msg7 *msg; 639 Msg7 *msg;
618 void *ref; 640 void *ref;
619 int msgcnt = 0, ret; 641 int msgcnt = 0, ret;
642 Ecore_Thread *eth1;
620 643
621 thq1 = eina_thread_queue_new(); 644 thq1 = eina_thread_queue_new();
622 if (!thq1) fail(); 645 if (!thq1) fail();
@@ -629,7 +652,7 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
629 ret = eina_thread_queue_fd_get(thq1); 652 ret = eina_thread_queue_fd_get(thq1);
630 fail_if(ret != p[1]); 653 fail_if(ret != p[1]);
631 654
632 ecore_thread_feedback_run(thspeed7_do, NULL, NULL, NULL, NULL, EINA_TRUE); 655 eth1 = ecore_thread_feedback_run(thspeed7_do, NULL, NULL, NULL, NULL, EINA_TRUE);
633 for (;;) 656 for (;;)
634 { 657 {
635 char buf; 658 char buf;
@@ -645,7 +668,10 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
645 if (msgcnt == 10000) break; 668 if (msgcnt == 10000) break;
646 } 669 }
647 if (DEBUG) printf("msg fd ok\n"); 670 if (DEBUG) printf("msg fd ok\n");
648 671 ecore_thread_wait(eth1, 0.1);
672 eina_thread_queue_free(thq1);
673 close(p[0]);
674 close(p[1]);
649} 675}
650EFL_END_TEST 676EFL_END_TEST
651 677