[gnutls-devel] GnuTLS | priority: rework config reloading logic and locking (!1483)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Nov 5 13:48:58 CET 2021




Alexander Sosedkin commented on a discussion on lib/priority.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_725187640

> +	if (system_priority_file_loaded &&
>  	    sb.st_mtime == system_priority_last_mod) {
>  		_gnutls_debug_log("cfg: system priority %s has not changed\n",
>  				  system_priority_file);
>  		goto out;
>  	}
>  
> -	_name_val_array_clear(&system_wide_priority_strings);
> -	system_wide_priority_strings_init = 0;
> +	GNUTLS_STATIC_RWLOCK_UNLOCK(system_wide_config_rwlock);
> +
> +	GNUTLS_STATIC_RWLOCK_WRLOCK(system_wide_config_rwlock);
> +
> +	/* Another thread has updated the system wide config while upgrading to
> +	 * write lock. */
> +	if (system_priority_last_mod >= sb.st_mtime) {

Sorry, that'd be `==`, not `!=`.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1483#note_725187640
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20211105/76939a73/attachment-0001.html>


More information about the Gnutls-devel mailing list