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. */
/* 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 */