mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / innodb_plugin / include / thr0loc.h
blob497ca0829ca29499d0d1ee9d3c2c97f0f0dbd969
1 /*****************************************************************************
3 Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *****************************************************************************/
19 /**************************************************//**
20 @file include/thr0loc.h
21 The thread local storage
23 Created 10/5/1995 Heikki Tuuri
24 *******************************************************/
26 /* This module implements storage private to each thread,
27 a capability useful in some situations like storing the
28 OS handle to the current thread, or its priority. */
30 #ifndef thr0loc_h
31 #define thr0loc_h
33 #include "univ.i"
34 #include "os0thread.h"
36 /****************************************************************//**
37 Initializes the thread local storage module. */
38 UNIV_INTERN
39 void
40 thr_local_init(void);
41 /*================*/
42 /****************************************************************//**
43 Close the thread local storage module. */
44 UNIV_INTERN
45 void
46 thr_local_close(void);
47 /*=================*/
48 /*******************************************************************//**
49 Creates a local storage struct for the calling new thread. */
50 UNIV_INTERN
51 void
52 thr_local_create(void);
53 /*==================*/
54 /*******************************************************************//**
55 Frees the local storage struct for the specified thread. */
56 UNIV_INTERN
57 void
58 thr_local_free(
59 /*===========*/
60 os_thread_id_t id); /*!< in: thread id */
61 /*******************************************************************//**
62 Gets the slot number in the thread table of a thread.
63 @return slot number */
64 UNIV_INTERN
65 ulint
66 thr_local_get_slot_no(
67 /*==================*/
68 os_thread_id_t id); /*!< in: thread id of the thread */
69 /*******************************************************************//**
70 Sets in the local storage the slot number in the thread table of a thread. */
71 UNIV_INTERN
72 void
73 thr_local_set_slot_no(
74 /*==================*/
75 os_thread_id_t id, /*!< in: thread id of the thread */
76 ulint slot_no);/*!< in: slot number */
77 /*******************************************************************//**
78 Returns pointer to the 'in_ibuf' field within the current thread local
79 storage.
80 @return pointer to the in_ibuf field */
81 UNIV_INTERN
82 ibool*
83 thr_local_get_in_ibuf_field(void);
84 /*=============================*/
86 #ifndef UNIV_NONINL
87 #include "thr0loc.ic"
88 #endif
90 #endif