Commit 236a2766 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Initialize the configuration R/W lock statically

The lock is static anyway (and so is the data).
parent 4707b4f4
......@@ -36,7 +36,7 @@
#include "configuration.h"
#include "modules/modules.h"
vlc_rwlock_t config_lock;
vlc_rwlock_t config_lock = VLC_STATIC_RWLOCK;
static inline char *strdupnull (const char *src)
{
......
......@@ -92,7 +92,6 @@ void module_InitBank (void)
if (likely(module != NULL))
module_StoreBank (module);
vlc_rwlock_init (&config_lock);
config_SortConfig ();
}
modules.usage++;
......@@ -126,7 +125,6 @@ void module_EndBank (bool b_plugins)
if (--modules.usage == 0)
{
config_UnsortConfig ();
vlc_rwlock_destroy (&config_lock);
head = modules.head;
modules.head = NULL;
}
......
......@@ -39,6 +39,7 @@
#ifdef UNDER_CE
# include <mmsystem.h>
#endif
#include "config/configuration.h"
static vlc_threadvar_t thread_key;
......@@ -79,9 +80,11 @@ BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
return FALSE;
InitializeCriticalSection (&super_mutex);
vlc_threadvar_create (&thread_key, NULL);
vlc_rwlock_init (&config_lock);
break;
case DLL_PROCESS_DETACH:
vlc_rwlock_destroy (&config_lock);
vlc_threadvar_delete (&thread_key);
DeleteCriticalSection (&super_mutex);
CloseHandle (super_cond);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment