1 /* glpenv02.c (thread local storage) */
3 /***********************************************************************
4 * This code is part of GLPK (GNU Linear Programming Kit).
6 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
7 * 2009, 2010 Andrew Makhorin, Department for Applied Informatics,
8 * Moscow Aviation Institute, Moscow, Russia. All rights reserved.
9 * E-mail: <mao@gnu.org>.
11 * GLPK is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
16 * GLPK is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 * License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GLPK. If not, see <http://www.gnu.org/licenses/>.
23 ***********************************************************************/
27 static void *tls = NULL;
28 /* in a re-entrant version of the package this variable must be placed
29 in the Thread Local Storage (TLS) */
31 /***********************************************************************
34 * tls_set_ptr - store global pointer in TLS
39 * void tls_set_ptr(void *ptr);
43 * The routine tls_set_ptr stores a pointer specified by the parameter
44 * ptr in the Thread Local Storage (TLS). */
46 void tls_set_ptr(void *ptr)
51 /***********************************************************************
54 * tls_get_ptr - retrieve global pointer from TLS
59 * void *tls_get_ptr(void);
63 * The routine tls_get_ptr returns a pointer previously stored by the
64 * routine tls_set_ptr. If the latter has not been called yet, NULL is
67 void *tls_get_ptr(void)