summaryrefslogtreecommitdiffstats
path: root/libvncserver/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/main.c')
-rw-r--r--libvncserver/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 41d70ea..972ce6f 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -61,6 +61,12 @@ void
rfbRegisterProtocolExtension(rfbProtocolExtension* extension)
{
rfbProtocolExtension* last;
+ static extMutex_initialized = 0;
+
+ if (! extMutex_initialized) {
+ INIT_MUTEX(extMutex);
+ extMutex_initialized = 1;
+ }
LOCK(extMutex);
last = extension;