summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-10-11 17:28:09 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-10-11 17:30:35 +0900
commit68a4e85483ec50c12ef3984a33e42c3bdd373790 (patch)
tree7730bb62b84fc2e70bfa990ad47859498dfa6bc1 /src
parent875e7cf74de68d05f6fd28d26ad8bddab7782316 (diff)
eina: that stuff was just for adding a bug in fact.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_inline_lock_posix.x17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/lib/eina/eina_inline_lock_posix.x b/src/lib/eina/eina_inline_lock_posix.x
index 472717774f..2e5b038ea4 100644
--- a/src/lib/eina/eina_inline_lock_posix.x
+++ b/src/lib/eina/eina_inline_lock_posix.x
@@ -600,27 +600,16 @@ static inline Eina_Lock_Result
600eina_spinlock_take(Eina_Spinlock *spinlock) 600eina_spinlock_take(Eina_Spinlock *spinlock)
601{ 601{
602#ifdef EINA_HAVE_POSIX_SPINLOCK 602#ifdef EINA_HAVE_POSIX_SPINLOCK
603 Eina_Bool yield;
604 int t; 603 int t;
605 604
606 do { 605 do {
607 yield = EINA_FALSE;
608
609 t = pthread_spin_trylock(spinlock); 606 t = pthread_spin_trylock(spinlock);
610 if (t != 0) 607 if (t != 0)
611 { 608 {
612 if (errno == EBUSY) 609 if (errno == EBUSY) sched_yield();
613 { 610 else if (errno == EDEADLK) return EINA_LOCK_DEADLOCK;
614 sched_yield();
615 yield = EINA_TRUE;
616 }
617 else if (errno == EDEADLK)
618 {
619 return EINA_LOCK_DEADLOCK;
620 }
621 } 611 }
622 612 } while (t != 0);
623 } while (t != 0 && yield);
624 613
625 return t ? EINA_LOCK_FAIL : EINA_LOCK_SUCCEED; 614 return t ? EINA_LOCK_FAIL : EINA_LOCK_SUCCEED;
626#else 615#else