summaryrefslogtreecommitdiff
path: root/src/tests/eo/suite
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-10-06 16:27:28 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-10-06 17:57:45 +0900
commit9c95eda74869e7bd36a175929c6f6d1b38360c09 (patch)
tree56c3163b98f005dcecb6c63db2c02af11e97d88d /src/tests/eo/suite
parent6ce60a0de5ec5c28c06ecbcba0b7f0e1958a382d (diff)
eo: Fix deadlocks with composite objects
This happens with shared objects. The situation seems to be: 1. object has composited object a of class A in thread 1 2. call something on object a from thread 2, deadlock In fact, do anything from thread 2 on a shared object and you deadlock.
Diffstat (limited to 'src/tests/eo/suite')
-rw-r--r--src/tests/eo/suite/eo_test_general.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/tests/eo/suite/eo_test_general.c b/src/tests/eo/suite/eo_test_general.c
index b0f1bcd4e1..a48192f479 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -1371,7 +1371,7 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
1371{ 1371{
1372 Data *d = data; 1372 Data *d = data;
1373 Efl_Id_Domain dom; 1373 Efl_Id_Domain dom;
1374 Eo *objs2; 1374 Eo *s1, *s2;
1375 1375
1376 fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE); 1376 fail_if(efl_domain_switch(EFL_ID_DOMAIN_THREAD) != EINA_TRUE);
1377 fail_if(efl_domain_get() != EFL_ID_DOMAIN_THREAD); 1377 fail_if(efl_domain_get() != EFL_ID_DOMAIN_THREAD);
@@ -1382,12 +1382,28 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
1382 printf("VERIFY finalized_get()\n"); 1382 printf("VERIFY finalized_get()\n");
1383 fail_if(!efl_finalized_get(d->objs)); 1383 fail_if(!efl_finalized_get(d->objs));
1384 1384
1385 printf("VERIFY parent_set(invalid)\n"); 1385 printf("VERIFY parent_set(invalid) -- WILL SHOW ERRORS\n");
1386 efl_domain_current_push(EFL_ID_DOMAIN_SHARED); 1386 efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
1387 objs2 = efl_add(DOMAIN_CLASS, NULL); 1387 s1 = efl_add(DOMAIN_CLASS, NULL);
1388 efl_domain_current_pop(); 1388 efl_domain_current_pop();
1389 efl_del(objs2); 1389 efl_del(s1);
1390 efl_parent_set(d->objs, objs2); 1390 efl_parent_set(d->objs, s1);
1391 printf("END OF ERRORS\n");
1392
1393 printf("VERIFY composite\n");
1394 efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
1395 s1 = efl_add(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 7));
1396 s2 = efl_add(SIMPLE_CLASS, NULL, simple_a_set(efl_added, 42));
1397 efl_domain_current_pop();
1398
1399 efl_composite_attach(d->objs, s1);
1400 int i1 = simple_a_get(d->objs);
1401 int i2 = simple_a_get(s1);
1402 fail_if(i1 != i2);
1403 fail_if(efl_composite_attach(d->objs, s2));
1404 efl_del(s1);
1405 fail_if(!efl_composite_attach(d->objs, s2));
1406 efl_del(s2);
1391 1407
1392 printf("SET ON LOCAL\n"); 1408 printf("SET ON LOCAL\n");
1393 domain_a_set(obj, 1234); 1409 domain_a_set(obj, 1234);
@@ -1430,7 +1446,7 @@ thr1(void *data, Eina_Thread t EINA_UNUSED)
1430static void 1446static void
1431_timeout(int val EINA_UNUSED) 1447_timeout(int val EINA_UNUSED)
1432{ 1448{
1433 printf("TIMED OUT!\n"); 1449 EINA_LOG_CRIT("TIMED OUT!");
1434 exit(-1); 1450 exit(-1);
1435} 1451}
1436#endif 1452#endif