1
by brian
clean slate |
1 |
/******************************************************
|
2 |
The thread local storage
|
|
3 |
||
4 |
(c) 1995 Innobase Oy
|
|
5 |
||
6 |
Created 10/5/1995 Heikki Tuuri
|
|
7 |
*******************************************************/
|
|
8 |
||
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. */
|
|
12 |
||
13 |
#ifndef thr0loc_h
|
|
14 |
#define thr0loc_h
|
|
15 |
||
16 |
#include "univ.i" |
|
17 |
#include "os0thread.h" |
|
18 |
||
19 |
/********************************************************************
|
|
20 |
Initializes the thread local storage module. */
|
|
21 |
||
22 |
void
|
|
23 |
thr_local_init(void); |
|
24 |
/*================*/
|
|
25 |
/***********************************************************************
|
|
26 |
Creates a local storage struct for the calling new thread. */
|
|
27 |
||
28 |
void
|
|
29 |
thr_local_create(void); |
|
30 |
/*==================*/
|
|
31 |
/***********************************************************************
|
|
32 |
Frees the local storage struct for the specified thread. */
|
|
33 |
||
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. */
|
|
40 |
||
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. */
|
|
48 |
||
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. */
|
|
57 |
||
58 |
ibool* |
|
59 |
thr_local_get_in_ibuf_field(void); |
|
60 |
/*=============================*/
|
|
61 |
/* out: pointer to the in_ibuf field */
|
|
62 |
||
63 |
#ifndef UNIV_NONINL
|
|
64 |
#include "thr0loc.ic" |
|
65 |
#endif
|
|
66 |
||
67 |
#endif
|