10 #include <win32thread.h>
11 #define PERL_THREAD_DETACH(t)
12 #define PERL_THREAD_SETSPECIFIC(k,v) TlsSetValue(k,v)
13 #define PERL_THREAD_GETSPECIFIC(k,v) v = TlsGetValue(k)
14 #define PERL_THREAD_ALLOC_SPECIFIC(k) \
16 if((k = TlsAlloc()) == TLS_OUT_OF_INDEXES) {\
17 PerlIO_printf(PerlIO_stderr(),"panic threads.h: TlsAlloc");\
25 #define PERL_THREAD_SETSPECIFIC(k,v) pthread_setspecific(k,v)
26 #define PERL_THREAD_ALLOC_SPECIFIC(k) STMT_START {\
27 if(pthread_key_create(&(k),0)) {\
28 PerlIO_printf(PerlIO_stderr(), "panic threads.h: pthread_key_create");\
32 #ifdef OLD_PTHREADS_API
33 #define PERL_THREAD_DETACH(t) pthread_detach(&(t))
34 #define PERL_THREAD_GETSPECIFIC(k,v) pthread_getspecific(k,&v)
36 #define PERL_THREAD_DETACH(t) pthread_detach((t))
37 #define PERL_THREAD_GETSPECIFIC(k,v) v = pthread_getspecific(k)
42 PerlInterpreter *interp; /* The threads interpreter */
43 I32 tid; /* Our thread */
44 perl_mutex mutex; /* our mutex */
45 I32 count; /* how many threads have a reference to us */
46 signed char detached; /* are we detached ? */
59 static perl_mutex create_mutex; /* protects the creation of threads ??? */
71 /* internal functions */
73 THREAD_RET_TYPE Perl_thread_run(LPVOID arg);
75 void* Perl_thread_run(void * arg);
77 void Perl_thread_destruct(ithread* thread);
79 /* Perl mapped functions to iThread:: */
80 SV* Perl_thread_create(char* class, SV* function_to_call, SV* params);
81 I32 Perl_thread_tid (SV* obj);
82 void Perl_thread_join(SV* obj);
83 void Perl_thread_detach(SV* obj);
84 SV* Perl_thread_self (char* class);