<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>



<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.com/dueno">Daiki Ueno</a>
commented on a
discussion on <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_720721773">lib/priority.c</a>:
</p>
<table>
<tr class="line_holder" id="">
<td class="old_line diff-line-num" data-linenumber="1452" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1452
</td>
<td class="new_line diff-line-num" data-linenumber="1443" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1443
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC1443" class="line" lang="c"><span class="cm" style="color: #998; font-style: italic;">                        * allow it to be updated without restarting</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="">
<td class="old_line diff-line-num" data-linenumber="1453" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1453
</td>
<td class="new_line diff-line-num" data-linenumber="1444" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1444
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC1444" class="line" lang="c"><span class="cm" style="color: #998; font-style: italic;">                        * all applications</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="">
<td class="old_line diff-line-num" data-linenumber="1454" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1454
</td>
<td class="new_line diff-line-num" data-linenumber="1445" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1445
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC1445" class="line" lang="c"><span class="cm" style="color: #998; font-style: italic;">                        */</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="">
<td class="old_line diff-line-num new" data-linenumber="1455" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="1446" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
1446
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC1446" class="line" lang="c">                   <span class="n" style="color: #333;">GNUTLS_STATIC_MUTEX_LOCK</span><span class="p">(</span><span class="n" style="color: #333;">system_wide_config_mutex</span><span class="p">);</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="">
<td class="old_line diff-line-num" data-linenumber="1455" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1455
</td>
<td class="new_line diff-line-num" data-linenumber="1447" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
1447
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC1447" class="line" lang="c">                   <span class="n" style="color: #333;">_gnutls_update_system_priorities</span><span class="p">();</span></span>
</pre>
</td>
</tr>

</table>
<div style="">
<p dir="auto">Let me add a bit of the context of this change: in the previous version, we had mutex lock/unlock in <code>_gnutls_update_system_priorities</code>. This was not sufficient, because in the following line we have a read access with <code>_name_val_array_value</code>. So this is the approach to keep the critical section minimal.</p>
<p dir="auto">On the other hand, I tend to think this should be protected with an RW lock instead of mutex (because there could be multiple reader of the global variables, while there should be a single writer). The current GnuTLS code base doesn't have any abstraction of RW lock, but maybe we could import <code>pthread-rwlock</code> from Gnulib.</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_720721773">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/26da253a608c63524c446bc3e309e355/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_720721773"}}</script>


</p>
</div>
</body>
</html>