3 * Copyright © 2001 Novell, Inc. All Rights Reserved.
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 * FILENAME : nw5thread.c
12 * DESCRIPTION : Thread related functions.
14 * Date : January 2001.
23 //For Thread Local Storage
24 #include "win32ish.h" // For "BOOL", "TRUE" and "FALSE"
27 #ifdef USE_DECLSPEC_THREAD
28 __declspec(thread) void *PL_current_context = NULL;
33 Perl_set_context(void *t)
35 #if defined(USE_ITHREADS)
36 # ifdef USE_DECLSPEC_THREAD
37 Perl_current_context = t;
39 fnAddThreadCtx(PL_thr_key, t);
46 Perl_get_context(void)
48 #if defined(USE_ITHREADS)
49 # ifdef USE_DECLSPEC_THREAD
50 return Perl_current_context;
52 return(fnGetThreadCtx(PL_thr_key));
60 //To Remove the Thread Context stored during Perl_set_context
62 Remove_Thread_Ctx(void)
64 #if defined(USE_ITHREADS)
65 # ifdef USE_DECLSPEC_THREAD
68 return(fnRemoveThreadCtx(PL_thr_key));
76 //PL_thr_key - Not very sure if this is global or per thread. When multiple scripts
77 //run simultaneously on NetWare, this will give problems. Hence in nwtinfo.c, the
78 //current thread id is used as the TLS index & PL_thr_key is not used.
79 //This has to be checked???? - sgp