X-Git-Url: http://git.silcnet.org/gitweb/?p=runtime.git;a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcthread_i.h;h=f7c6697f1b2be45e4cb6d0a8e3017d739811f8f4;hp=d0d2fd737f2dd66a775e086f9ad0a41116c2fb65;hb=b4dc1a71c928fdc0ec885ed5745b0d17b094ff7e;hpb=a788ad407a51e84cfd41fedc6c053e62283ea2d7 diff --git a/lib/silcutil/silcthread_i.h b/lib/silcutil/silcthread_i.h index d0d2fd73..f7c6697f 100644 --- a/lib/silcutil/silcthread_i.h +++ b/lib/silcutil/silcthread_i.h @@ -29,12 +29,17 @@ 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 */