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 {
+ 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 */
+ char filename[256]; /* File where error occurred */
SilcResult error; /* Errno, last error */
+ SilcUInt32 cur_line; /* Line number of error */
+ SilcUInt32 cur_column; /* Column number of 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 */