[x264-devel] [patch]fix a mutex init error

Shi Qiu qiushics at gmail.com
Fri Mar 31 04:07:59 CEST 2017


Do you mean global mutex here:

https://git.videolan.org/?p=x264.git;a=blob;f=common/win32thread.c;h=94e9d898fa0adc0a70a051655d265d086c3d6b09;hb=HEAD#l94

*mutex = static_mutex;

If the attribute is  UNUSED, the actual mutex is static_mutex

But copy the CRITICAL_SECTION is invalid according to MSDN (
https://msdn.microsoft.com/en-us/library/ms683472(v=VS.85).aspx)

The mutex is still uninitialized.

So may change the implementation ( for example: using pointer) ?

On Thu, Mar 30, 2017 at 2:46 PM, BugMaster <BugMaster at narod.ru> wrote:

> On Thu, 30 Mar 2017 10:54:37 +0800, Shi Qiu wrote:
> > It seems that cost_ref_mutex is used now, but now inited. (May crash
> some times)
>
> UNUSED attribute was probably accidently added in
> http://git.videolan.org/?p=x264/x264-sandbox.git;a=commit;h=
> 30b3825ed00f7f88397a26760cac5248f2f8e226
> As for x264_pthread_mutex_init/x264_pthread_mutex_destroy they are not
> needed here because it use global mutex of X264_PTHREAD_MUTEX_INITIALIZER
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> https://mailman.videolan.org/listinfo/x264-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20170331/ba62bcfa/attachment.html>


More information about the x264-devel mailing list