Hi,

On 2 March 2016 at 10:36, Carsten Haitzler <ras...@rasterman.com> wrote:

> raster pushed a commit to branch master.
>
>
> http://git.enlightenment.org/core/efl.git/commit/?id=7920e66f29e7b2bed8f58d1768c008b199be322a
>
> commit 7920e66f29e7b2bed8f58d1768c008b199be322a
> Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
> Date:   Wed Mar 2 10:33:40 2016 +0900
>
>     efl - fix threadqueue spinlock destruction on openbsd - doesn't like it
>
>     so the spinlock on the threadqueue block pool it taken on shutdownn,
>     while the block pool is freed up then its is destroyed, but openbsd
>     very much doesnt like this and returns an error, so release the lock
>     before destroying it.
>

Well there is something fundamentally wrong with taking a lock before
destroying it.
If it's still "valid" (ie. other threads rely on it), then it shouldn't be
destroyed. Otherwise there is no need to lock.

Destroying a locking primitive when it's locked is a bad idea ("undefined
behaviour").

So I wonder why the lock was taken there in the first place during shutdown.


>
>     @fix
> ---
>  src/lib/eina/eina_thread_queue.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/lib/eina/eina_thread_queue.c
> b/src/lib/eina/eina_thread_queue.c
> index 3a012ea..dc92db5 100644
> --- a/src/lib/eina/eina_thread_queue.c
> +++ b/src/lib/eina/eina_thread_queue.c
> @@ -171,6 +171,7 @@ _eina_thread_queue_msg_block_pool_shutdown(void)
>               _eina_thread_queue_block_pool = blknext;
>            }
>       }
> +   eina_spinlock_release(&(_eina_thread_queue_block_pool_lock));
>     eina_spinlock_free(&_eina_thread_queue_block_pool_lock);
>  }
>
>
> --
>
>
>


-- 
Jean-Philippe André
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to