Added SILC Rand API, SILC Global Variables API and silcruntime.h.in
[runtime.git] / lib / silcutil / silcthread_i.h
index d0d2fd737f2dd66a775e086f9ad0a41116c2fb65..f7c6697f1b2be45e4cb6d0a8e3017d739811f8f4 100644 (file)
    with silc_calloc and freeable with silc_free, and must also be able to
    pre-allocate from stack. */
 typedef struct SilcTlsObject {
-  SilcStack stack;                         /* Global stack */
-  SilcSchedule schedule;                   /* Global scheduler */
+  SilcMutex lock;                          /* Global lock, shared */
+  SilcHashTable variables;                 /* Global variables, shared */
+  SilcHashTable tls_variables;             /* Tls variables */
+  SilcStack stack;                         /* Thread's stack */
+  SilcSchedule schedule;                   /* Thread's scheduler */
   void *thread_context;                            /* Context set with SILC Tls API */
   void *platform_context;                  /* Platform specific context */
   char error_reason[256];                  /* Reason for the error */
   SilcResult error;                        /* Errno, last error */
+  unsigned int shared_data     : 1;        /* Set when shares data with other
+                                              threads in the Tls. */
 } *SilcTls, SilcTlsStruct;
 
 /* The internal Tls API.  Implementation is platform specific. */
@@ -46,4 +51,8 @@ SilcTls silc_thread_tls_init(void);
 /* Return current thread's Tls structure. */
 SilcTls silc_thread_get_tls(void);
 
+/* Uninitialize whole Tls system (free shared data), called only once per
+   process. */
+void silc_thread_tls_uninit(void);
+
 #endif /* SILCTHREAD_I_H */