eina: fix destruction of the osx semaphores
authorJean Guyomarc'h <jean@guyomarch.bzh>
Mon, 4 Sep 2017 22:09:57 +0000 (00:09 +0200)
committerJean Guyomarc'h <jean@guyomarch.bzh>
Mon, 4 Sep 2017 22:45:04 +0000 (00:45 +0200)
Well... that's just embarassing... semaphore_destroy() actually takes
the mach task as its first parameter, not the second. This core
amazingly worked very fine on macOS earlier than Sierra.

Fixes T5245

src/lib/eina/eina_lock.c

index 3423852..7681936 100644 (file)
@@ -303,7 +303,7 @@ _eina_semaphore_free(Eina_Semaphore *sem)
    if (sem)
      {
 #if defined(EINA_HAVE_OSX_SEMAPHORE)
-        return (semaphore_destroy(*sem, mach_task_self()) == KERN_SUCCESS)
+        return (semaphore_destroy(mach_task_self(), *sem) == KERN_SUCCESS)
         ? EINA_TRUE : EINA_FALSE;
 #else
         return (sem_destroy(sem) == 0) ? EINA_TRUE : EINA_FALSE;