This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove the final remnants of 5005threads support
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Sun, 19 Jul 2020 17:01:36 +0000 (18:01 +0100)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Mon, 20 Jul 2020 20:31:43 +0000 (21:31 +0100)
Only THREAD_RET_TYPE is still used.

NetWare/nw5thread.h
makedef.pl
os2/os2.c
perl.h
thread.h
win32/win32thread.h

index b1a2534..e7d8675 100644 (file)
@@ -165,7 +165,6 @@ extern __declspec(thread) void *PL_current_context;
 
 //Check the following, will be used in Thread extension - CHKSGP
 #define THREAD_RET_TYPE        unsigned __stdcall
-#define THREAD_RET_CAST(p)     ((unsigned)(p))
 
 #define INIT_THREADS           NOOP
 
index f1a7581..4bd8931 100644 (file)
@@ -363,34 +363,6 @@ unless ($define{'USE_ITHREADS'}) {
     ++$skip{PL_user_def_props_aTHX};
 }
 
-# USE_5005THREADS symbols. Kept as reference for easier removal
-++$skip{$_} foreach qw(
-                   PL_sv_mutex
-                   PL_strtab_mutex
-                   PL_svref_mutex
-                   PL_cred_mutex
-                   PL_eval_mutex
-                   PL_fdpid_mutex
-                   PL_sv_lock_mutex
-                   PL_eval_cond
-                   PL_eval_owner
-                   PL_threads_mutex
-                   PL_nthreads
-                   PL_nthreads_cond
-                   PL_threadnum
-                   PL_threadsv_names
-                   PL_thrsv
-                   PL_vtbl_mutex
-                   Perl_condpair_magic
-                   Perl_new_struct_thread
-                   Perl_per_thread_magicals
-                   Perl_thread_create
-                   Perl_find_threadsv
-                   Perl_unlock_condpair
-                   Perl_magic_mutexfree
-                   Perl_sv_lock
-                    );
-
 unless ($define{'USE_ITHREADS'}) {
     ++$skip{$_} foreach qw(
                     PL_keyword_plugin_mutex
@@ -831,7 +803,6 @@ if ($ARGS{PLATFORM} eq 'win32') {
                    win32_get_childenv
                    win32_spawnvp
                    Perl_init_os_extras
-                   Perl_thread_create
                    Perl_win32_init
                    Perl_win32_term
                    RunPerl
@@ -1143,7 +1114,6 @@ elsif ($ARGS{PLATFORM} eq 'os2') {
 elsif ($ARGS{PLATFORM} eq 'netware') {
     try_symbols(qw(
                        Perl_init_os_extras
-                       Perl_thread_create
                        Perl_nw5_init
                        RunPerl
                        AllocStdPerl
index 0c9fa17..e6faafa 100644 (file)
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -215,7 +215,7 @@ static struct perlos2_state_t {
 
 const Perl_PFN * const pExtFCN = (Perl_po2()->po2_ExtFCN);
 
-#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
+#if defined(USE_ITHREADS)
 
 typedef void (*emx_startroutine)(void *);
 typedef void* (*pthreads_startroutine)(void *);
@@ -5362,7 +5362,7 @@ gcvt_os2 (double value, int digits, char *buffer)
 #undef fork
 int fork_with_resources()
 {
-#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) && !defined(USE_SLOW_THREAD_SPECIFIC)
+#if defined(USE_ITHREADS) && !defined(USE_SLOW_THREAD_SPECIFIC)
   dTHX;
   void *ctx = PERL_GET_CONTEXT;
 #endif
@@ -5370,7 +5370,7 @@ int fork_with_resources()
   int rc = fork();
 
   if (rc == 0) {                       /* child */
-#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) && !defined(USE_SLOW_THREAD_SPECIFIC)
+#if defined(USE_ITHREADS) && !defined(USE_SLOW_THREAD_SPECIFIC)
     ALLOC_THREAD_KEY;                  /* Acquire the thread-local memory */
     PERL_SET_CONTEXT(ctx);             /* Reinit the thread-local memory */
 #endif
diff --git a/perl.h b/perl.h
index d444fa9..d1ecd98 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3090,12 +3090,6 @@ freeing any remaining Perl interpreters.
 #  endif
 #endif
 
-/* USE_5005THREADS needs to be after unixish.h as <pthread.h> includes
- * <sys/signal.h> which defines NSIG - which will stop inclusion of <signal.h>
- * this results in many functions being undeclared which bothers C++
- * May make sense to have threads after "*ish.h" anyway
- */
-
 /* clang Thread Safety Analysis/Annotations/Attributes
  * http://clang.llvm.org/docs/ThreadSafetyAnalysis.html
  *
index 2603d54..e695889 100644 (file)
--- a/thread.h
+++ b/thread.h
        *c = 0;                                                 \
     } STMT_END
 
-#define THREAD_CREATE(thr, f)  (thr->self = cthread_fork(f, thr), 0)
-#define THREAD_POST_CREATE(thr)        NOOP
-
 #define THREAD_RET_TYPE                any_t
-#define THREAD_RET_CAST(x)     ((any_t) x)
 
 #define DETACH(t)              cthread_detach(t->self)
 #define JOIN(t, avp)           (*(avp) = MUTABLE_AV(cthread_join(t->self)))
 
 #ifndef THREAD_RET_TYPE
 #  define THREAD_RET_TYPE      void *
-#  define THREAD_RET_CAST(p)   ((void *)(p))
 #endif /* THREAD_RET */
 
 #  define LOCK_DOLLARZERO_MUTEX                MUTEX_LOCK(&PL_dollarzero_mutex)
index 9af3aa3..9ac964c 100644 (file)
@@ -104,9 +104,6 @@ typedef HANDLE perl_mutex;
     } STMT_END
 
 
-#define THREAD_CREATE(t, f)    Perl_thread_create(t, f)
-#define THREAD_POST_CREATE(t)  NOOP
-
 /* XXX Docs mention that the RTL versions of thread creation routines
  * should be used, but that advice only seems applicable when the RTL
  * is not in a DLL.  RTL DLLs seem to do all of the init/deinit required
@@ -124,15 +121,12 @@ typedef HANDLE perl_mutex;
 #  include <process.h>
 #  if defined (_MSC_VER)
 #    define THREAD_RET_TYPE    unsigned __stdcall
-#    define THREAD_RET_CAST(p) ((unsigned)(p))
 #  else
      /* CRTDLL.DLL doesn't allow a return value from thread function! */
 #    define THREAD_RET_TYPE    void __cdecl
-#    define THREAD_RET_CAST(p) ((void)(thr->i.retv = (void *)(p)))
 #  endif
 #else  /* !USE_RTL_THREAD_API */
 #  define THREAD_RET_TYPE      DWORD WINAPI
-#  define THREAD_RET_CAST(p)   ((DWORD)(p))
 #endif /* !USE_RTL_THREAD_API */
 
 typedef THREAD_RET_TYPE thread_func_t(void *);