diff options
author | H.Merijn Brand <h.m.brand@xs4all.nl> | 2002-10-19 14:10:21 +0000 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2002-10-19 14:10:21 +0000 |
commit | 3db8f154c4c6e098a5a0bdf7932e8f86fbd2c451 (patch) | |
tree | 304393fdb48236335e35a83047fba6223e13f602 /wince | |
parent | efc41c8ef9279ab1e5f723c2c73a85333a96e0e2 (diff) | |
download | perl-3db8f154c4c6e098a5a0bdf7932e8f86fbd2c451.tar.gz |
Happy chainsaw stories; The removal of the 5005 threads
Still imcomplete. Configure will follow
p4raw-id: //depot/perl@18030
Diffstat (limited to 'wince')
-rw-r--r-- | wince/Makefile.ce | 15 | ||||
-rw-r--r-- | wince/config.ce | 1 | ||||
-rw-r--r-- | wince/config_H.ce | 8 | ||||
-rw-r--r-- | wince/config_sh.PL | 7 | ||||
-rw-r--r-- | wince/win32.h | 26 | ||||
-rw-r--r-- | wince/win32thread.c | 80 | ||||
-rw-r--r-- | wince/win32thread.h | 10 | ||||
-rw-r--r-- | wince/wincesck.c | 9 |
8 files changed, 11 insertions, 145 deletions
diff --git a/wince/Makefile.ce b/wince/Makefile.ce index f31ed989b7..2771bcc36a 100644 --- a/wince/Makefile.ce +++ b/wince/Makefile.ce @@ -375,14 +375,6 @@ CRYPT_FLAG = -DHAVE_DES_FCRYPT PERL_MALLOC = undef !ENDIF -!IF "$(USE_5005THREADS)" == "" -USE_5005THREADS = undef -!ENDIF - -!IF "$(USE_5005THREADS)" == "define" -USE_ITHREADS = undef -!ENDIF - !IF "$(USE_IMP_SYS)" == "define" PERL_MALLOC = undef !ENDIF @@ -407,16 +399,15 @@ USE_PERLIO = undef USE_PERLCRT = undef !ENDIF -!IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)" == "defineundefundef" +!IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef" USE_MULTI = define !ENDIF !IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef" USE_MULTI = define -USE_5005THREADS = undef !ENDIF -!IF "$(USE_MULTI)$(USE_5005THREADS)" != "undefundef" +!IF "$(USE_MULTI)" != "undef" BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT !ENDIF @@ -749,9 +740,7 @@ CFG_VARS = \ "static_ext=$(STATIC_EXT)" \ "dynamic_ext=$(DYNAMIC_EXT)" \ "nonxs_ext=$(NONXS_EXT)" \ - "use5005threads=$(USE_5005THREADS)" \ "useithreads=$(USE_ITHREADS)" \ - "usethreads=$(USE_5005THREADS)" \ "usemultiplicity=$(USE_MULTI)" \ "useperlio=$(USE_PERLIO)" \ "LINK_FLAGS=$(LDLIBPATH) $(LINK_FLAGS) $(SUBSYS)" \ diff --git a/wince/config.ce b/wince/config.ce index a467a45112..1d7e8b3780 100644 --- a/wince/config.ce +++ b/wince/config.ce @@ -852,7 +852,6 @@ uidtype='uid_t' uname='uname' uniq='uniq' uquadtype='unsigned __int64' -use5005threads='undef' use64bitall='undef' use64bitint='undef' usedl='define' diff --git a/wince/config_H.ce b/wince/config_H.ce index b246ce69bd..aaff6d2b21 100644 --- a/wince/config_H.ce +++ b/wince/config_H.ce @@ -3493,10 +3493,6 @@ * This symbol, if defined, indicates that Perl should be built to * use the interpreter-based threading implementation. */ -/* USE_5005THREADS: - * This symbol, if defined, indicates that Perl should be built to - * use the 5.005-based threading implementation. - */ /* OLD_PTHREADS_API: * This symbol, if defined, indicates that Perl should * be built to use the old draft POSIX threads API. @@ -3506,11 +3502,7 @@ * try to use the various _r versions of library functions. * This is extremely experimental. */ -/*#define USE_5005THREADS /**/ /*#define USE_ITHREADS /**/ -#if defined(USE_5005THREADS) && !defined(USE_ITHREADS) -#define USE_THREADS /* until src is revised*/ -#endif /*#define OLD_PTHREADS_API /**/ /*#define USE_REENTRANT_API /**/ diff --git a/wince/config_sh.PL b/wince/config_sh.PL index 35bb6e26e3..0bcc77df5d 100644 --- a/wince/config_sh.PL +++ b/wince/config_sh.PL @@ -49,11 +49,8 @@ my @noxs = FindExt::noxs_extensions(); my @known = sort(@dynamic,split(/\s+/,$opt{'staticext'}),@noxs); $opt{'known_extensions'} = join(' ',@known); -if (!$opt{'use5005threads'} || $opt{'use5005threads'} eq 'undef') - { - @dynamic = grep(!/Thread/,@dynamic); - @known = grep(!/Thread/,@dynamic); - } +@dynamic = grep(!/Thread/,@dynamic); +@known = grep(!/Thread/,@dynamic); $opt{'dynamic_ext'} = join(' ',@dynamic); $opt{'nonxs_ext'} = join(' ',@noxs); diff --git a/wince/win32.h b/wince/win32.h index de2e628969..7d107c66ed 100644 --- a/wince/win32.h +++ b/wince/win32.h @@ -341,12 +341,6 @@ struct thread_intern { # endif }; -#ifdef USE_5005THREADS -# ifndef USE_DECLSPEC_THREAD -# define HAVE_THREAD_INTERN -# endif /* !USE_DECLSPEC_THREAD */ -#endif /* USE_5005THREADS */ - #define HAVE_INTERP_INTERN typedef struct { long num; @@ -365,9 +359,7 @@ struct interp_intern { child_tab * pseudo_children; #endif void * internal_host; -#ifndef USE_5005THREADS struct thread_intern thr_intern; -#endif }; @@ -385,19 +377,11 @@ struct interp_intern { #define w32_pseudo_child_pids (w32_pseudo_children->pids) #define w32_pseudo_child_handles (w32_pseudo_children->handles) #define w32_internal_host (PL_sys_intern.internal_host) -#ifdef USE_5005THREADS -# define w32_strerror_buffer (thr->i.Wstrerror_buffer) -# define w32_getlogin_buffer (thr->i.Wgetlogin_buffer) -# define w32_crypt_buffer (thr->i.Wcrypt_buffer) -# define w32_servent (thr->i.Wservent) -# define w32_init_socktype (thr->i.Winit_socktype) -#else -# define w32_strerror_buffer (PL_sys_intern.thr_intern.Wstrerror_buffer) -# define w32_getlogin_buffer (PL_sys_intern.thr_intern.Wgetlogin_buffer) -# define w32_crypt_buffer (PL_sys_intern.thr_intern.Wcrypt_buffer) -# define w32_servent (PL_sys_intern.thr_intern.Wservent) -# define w32_init_socktype (PL_sys_intern.thr_intern.Winit_socktype) -#endif /* USE_5005THREADS */ +#define w32_strerror_buffer (PL_sys_intern.thr_intern.Wstrerror_buffer) +#define w32_getlogin_buffer (PL_sys_intern.thr_intern.Wgetlogin_buffer) +#define w32_crypt_buffer (PL_sys_intern.thr_intern.Wcrypt_buffer) +#define w32_servent (PL_sys_intern.thr_intern.Wservent) +#define w32_init_socktype (PL_sys_intern.thr_intern.Winit_socktype) /* UNICODE<>ANSI translation helpers */ /* Use CP_ACP when mode is ANSI */ diff --git a/wince/win32thread.c b/wince/win32thread.c index 4675822c66..141c5d68a0 100644 --- a/wince/win32thread.c +++ b/wince/win32thread.c @@ -10,7 +10,7 @@ __declspec(thread) void *PL_current_context = NULL; void Perl_set_context(void *t) { -#if defined(USE_5005THREADS) || defined(USE_ITHREADS) +#if defined(USE_ITHREADS) # ifdef USE_DECLSPEC_THREAD Perl_current_context = t; # else @@ -24,7 +24,7 @@ Perl_set_context(void *t) void * Perl_get_context(void) { -#if defined(USE_5005THREADS) || defined(USE_ITHREADS) +#if defined(USE_ITHREADS) # ifdef USE_DECLSPEC_THREAD return Perl_current_context; # else @@ -37,79 +37,3 @@ Perl_get_context(void) return NULL; #endif } - -#ifdef USE_5005THREADS -void -Perl_init_thread_intern(struct perl_thread *athr) -{ -#ifndef USE_DECLSPEC_THREAD - - /* - * Initialize port-specific per-thread data in thr->i - * as only things we have there are just static areas for - * return values we don't _need_ to do anything but - * this is good practice: - */ - memset(&athr->i,0,sizeof(athr->i)); - -#endif -} - -void -Perl_set_thread_self(struct perl_thread *thr) -{ - /* Set thr->self. GetCurrentThread() retrurns a pseudo handle, need - this to convert it into a handle another thread can use. - */ - DuplicateHandle(GetCurrentProcess(), - GetCurrentThread(), - GetCurrentProcess(), - &thr->self, - 0, - FALSE, - DUPLICATE_SAME_ACCESS); -} - -int -Perl_thread_create(struct perl_thread *thr, thread_func_t *fn) -{ - DWORD junk; - unsigned long th; - - DEBUG_S(PerlIO_printf(Perl_debug_log, - "%p: create OS thread\n", thr)); -#ifdef USE_RTL_THREAD_API - /* See comment about USE_RTL_THREAD_API in win32thread.h */ -#if defined(__BORLANDC__) - th = _beginthreadNT(fn, /* start address */ - 0, /* stack size */ - (void *)thr, /* parameters */ - (void *)NULL, /* security attrib */ - 0, /* creation flags */ - (unsigned long *)&junk); /* tid */ - if (th == (unsigned long)-1) - th = 0; -#elif defined(_MSC_VER_) - th = _beginthreadex((void *)NULL, /* security attrib */ - 0, /* stack size */ - fn, /* start address */ - (void*)thr, /* parameters */ - 0, /* creation flags */ - (unsigned *)&junk); /* tid */ -#else /* compilers using CRTDLL.DLL only have _beginthread() */ - th = _beginthread(fn, /* start address */ - 0, /* stack size */ - (void*)thr); /* parameters */ - if (th == (unsigned long)-1) - th = 0; -#endif - thr->self = (HANDLE)th; -#else /* !USE_RTL_THREAD_API */ - thr->self = CreateThread(NULL, 0, fn, (void*)thr, 0, &junk); -#endif /* !USE_RTL_THREAD_API */ - DEBUG_S(PerlIO_printf(Perl_debug_log, - "%p: OS thread = %p, id=%ld\n", thr, thr->self, junk)); - return thr->self ? 0 : -1; -} -#endif - diff --git a/wince/win32thread.h b/wince/win32thread.h index 33e11a5c64..879819f6ab 100644 --- a/wince/win32thread.h +++ b/wince/win32thread.h @@ -156,16 +156,6 @@ extern __declspec(thread) void *PL_current_context; #define PERL_SET_CONTEXT(t) Perl_set_context(t) #endif -#if defined(USE_5005THREADS) -struct perl_thread; -int Perl_thread_create (struct perl_thread *thr, thread_func_t *fn); -void Perl_set_thread_self (struct perl_thread *thr); -void Perl_init_thread_intern (struct perl_thread *t); - -#define SET_THREAD_SELF(thr) Perl_set_thread_self(thr) - -#endif /* USE_5005THREADS */ - END_EXTERN_C #define INIT_THREADS NOOP diff --git a/wince/wincesck.c b/wince/wincesck.c index 003a250dd6..09f5dfbc2b 100644 --- a/wince/wincesck.c +++ b/wince/wincesck.c @@ -57,14 +57,6 @@ XCE_EXPORT struct protoent *xcegetprotobynumber(int number); #define TO_SOCKET(X) (X) -#ifdef USE_5005THREADS -#define StartSockets() \ - STMT_START { \ - if (!wsock_started) \ - start_sockets(); \ - set_socktype(); \ - } STMT_END -#else #define StartSockets() \ STMT_START { \ if (!wsock_started) { \ @@ -72,7 +64,6 @@ XCE_EXPORT struct protoent *xcegetprotobynumber(int number); set_socktype(); \ } \ } STMT_END -#endif #define EndSockets() \ STMT_START { \ |