<div dir="ltr">Do you mean global mutex here:<div><br><div><a href="https://git.videolan.org/?p=x264.git;a=blob;f=common/win32thread.c;h=94e9d898fa0adc0a70a051655d265d086c3d6b09;hb=HEAD#l94">https://git.videolan.org/?p=x264.git;a=blob;f=common/win32thread.c;h=94e9d898fa0adc0a70a051655d265d086c3d6b09;hb=HEAD#l94</a><br></div><div><br></div><div><span style="color:rgb(0,0,0);font-family:monospace;font-size:12px;white-space:pre">*mutex = static_mutex;</span><br></div></div><div><span style="color:rgb(0,0,0);font-family:monospace;font-size:12px;white-space:pre"><br></span></div><div>If the attribute is  UNUSED, the actual mutex is <span style="color:rgb(0,0,0);font-family:monospace;font-size:12px;white-space:pre">static_mutex</span></div><div><br></div><div>But copy the CRITICAL_SECTION is invalid according to MSDN (<a href="https://msdn.microsoft.com/en-us/library/ms683472(v=VS.85).aspx">https://msdn.microsoft.com/en-us/library/ms683472(v=VS.85).aspx</a>)<br></div><div><br></div><div>The mutex is still uninitialized. </div><div><br></div><div>So may change the implementation ( for example: using pointer) ?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 2:46 PM, BugMaster <span dir="ltr"><<a href="mailto:BugMaster@narod.ru" target="_blank">BugMaster@narod.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, 30 Mar 2017 10:54:37 +0800, Shi Qiu wrote:<br>
> It seems that cost_ref_mutex is used now, but now inited. (May crash some times)<br>
<br>
</span>UNUSED attribute was probably accidently added in<br>
<a href="http://git.videolan.org/?p=x264/x264-sandbox.git;a=commit;h=30b3825ed00f7f88397a26760cac5248f2f8e226" rel="noreferrer" target="_blank">http://git.videolan.org/?p=<wbr>x264/x264-sandbox.git;a=<wbr>commit;h=<wbr>30b3825ed00f7f88397a26760cac52<wbr>48f2f8e226</a><br>
As for x264_pthread_mutex_init/x264_<wbr>pthread_mutex_destroy they are not<br>
needed here because it use global mutex of X264_PTHREAD_MUTEX_INITIALIZER<br>
<br>
______________________________<wbr>_________________<br>
x264-devel mailing list<br>
<a href="mailto:x264-devel@videolan.org">x264-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x264-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x264-devel</a><br>
</blockquote></div><br></div>