+ /* Allocate global lock */
+ silc_mutex_alloc(&tls->lock);
+
+ return tls;
+}
+
+static SilcTls silc_thread_tls_init_shared(SilcTls other)
+{
+ SilcTls tls;
+
+ if (silc_thread_get_tls())
+ return silc_thread_get_tls();
+
+ /* Allocate Tls for the thread */
+ tls = (SilcTls)silc_calloc(1, sizeof(*tls));
+ if (!tls)
+ return NULL;
+
+ Dll::SetTls(tls);
+
+ /* Take shared data */
+ tls->shared_data = 1;
+ tls->lock = other->lock;
+ tls->variables = other->variables;
+