mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / innobase / include / thr0loc.h
blob32e2dc3ae9390bc6d1cb083904fff818fab2fc0b
1 /******************************************************
2 The thread local storage
4 (c) 1995 Innobase Oy
6 Created 10/5/1995 Heikki Tuuri
7 *******************************************************/
9 /* This module implements storage private to each thread,
10 a capability useful in some situations like storing the
11 OS handle to the current thread, or its priority. */
13 #ifndef thr0loc_h
14 #define thr0loc_h
16 #include "univ.i"
17 #include "os0thread.h"
19 /********************************************************************
20 Initializes the thread local storage module. */
22 void
23 thr_local_init(void);
24 /*================*/
25 /***********************************************************************
26 Creates a local storage struct for the calling new thread. */
28 void
29 thr_local_create(void);
30 /*==================*/
31 /***********************************************************************
32 Frees the local storage struct for the specified thread. */
34 void
35 thr_local_free(
36 /*===========*/
37 os_thread_id_t id); /* in: thread id */
38 /***********************************************************************
39 Gets the slot number in the thread table of a thread. */
41 ulint
42 thr_local_get_slot_no(
43 /*==================*/
44 /* out: slot number */
45 os_thread_id_t id); /* in: thread id of the thread */
46 /***********************************************************************
47 Sets in the local storage the slot number in the thread table of a thread. */
49 void
50 thr_local_set_slot_no(
51 /*==================*/
52 os_thread_id_t id, /* in: thread id of the thread */
53 ulint slot_no);/* in: slot number */
54 /***********************************************************************
55 Returns pointer to the 'in_ibuf' field within the current thread local
56 storage. */
58 ibool*
59 thr_local_get_in_ibuf_field(void);
60 /*=============================*/
61 /* out: pointer to the in_ibuf field */
63 #ifndef UNIV_NONINL
64 #include "thr0loc.ic"
65 #endif
67 #endif