Added SILC Rand API, SILC Global Variables API and silcruntime.h.in
[runtime.git] / lib / silcutil / silcthread_i.h
index 0038a616d862475504b005b4b0520c83db81ba3a..f7c6697f1b2be45e4cb6d0a8e3017d739811f8f4 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2007 Pekka Riikonen
+  Copyright (C) 2007 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
    with silc_calloc and freeable with silc_free, and must also be able to
    pre-allocate from stack. */
 typedef struct SilcTlsObject {
-  void *thread_context;                       /* Context set with SILC Tls API */
-  void *platform_context;             /* Platform specific context */
+  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. */
@@ -42,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 */