Skip to content

Commit 573edd3

Browse files
committed
Remove the final remnants of 5005threads support
Only THREAD_RET_TYPE is still used.
1 parent ae955d3 commit 573edd3

File tree

6 files changed

+3
-51
lines changed

6 files changed

+3
-51
lines changed

NetWare/nw5thread.h

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ extern __declspec(thread) void *PL_current_context;
165165

166166
//Check the following, will be used in Thread extension - CHKSGP
167167
#define THREAD_RET_TYPE unsigned __stdcall
168-
#define THREAD_RET_CAST(p) ((unsigned)(p))
169168

170169
#define INIT_THREADS NOOP
171170

makedef.pl

-30
Original file line numberDiff line numberDiff line change
@@ -363,34 +363,6 @@ sub readvar {
363363
++$skip{PL_user_def_props_aTHX};
364364
}
365365

366-
# USE_5005THREADS symbols. Kept as reference for easier removal
367-
++$skip{$_} foreach qw(
368-
PL_sv_mutex
369-
PL_strtab_mutex
370-
PL_svref_mutex
371-
PL_cred_mutex
372-
PL_eval_mutex
373-
PL_fdpid_mutex
374-
PL_sv_lock_mutex
375-
PL_eval_cond
376-
PL_eval_owner
377-
PL_threads_mutex
378-
PL_nthreads
379-
PL_nthreads_cond
380-
PL_threadnum
381-
PL_threadsv_names
382-
PL_thrsv
383-
PL_vtbl_mutex
384-
Perl_condpair_magic
385-
Perl_new_struct_thread
386-
Perl_per_thread_magicals
387-
Perl_thread_create
388-
Perl_find_threadsv
389-
Perl_unlock_condpair
390-
Perl_magic_mutexfree
391-
Perl_sv_lock
392-
);
393-
394366
unless ($define{'USE_ITHREADS'}) {
395367
++$skip{$_} foreach qw(
396368
PL_keyword_plugin_mutex
@@ -831,7 +803,6 @@ sub readvar {
831803
win32_get_childenv
832804
win32_spawnvp
833805
Perl_init_os_extras
834-
Perl_thread_create
835806
Perl_win32_init
836807
Perl_win32_term
837808
RunPerl
@@ -1143,7 +1114,6 @@ sub readvar {
11431114
elsif ($ARGS{PLATFORM} eq 'netware') {
11441115
try_symbols(qw(
11451116
Perl_init_os_extras
1146-
Perl_thread_create
11471117
Perl_nw5_init
11481118
RunPerl
11491119
AllocStdPerl

os2/os2.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static struct perlos2_state_t {
215215

216216
const Perl_PFN * const pExtFCN = (Perl_po2()->po2_ExtFCN);
217217

218-
#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
218+
#if defined(USE_ITHREADS)
219219

220220
typedef void (*emx_startroutine)(void *);
221221
typedef void* (*pthreads_startroutine)(void *);
@@ -5362,15 +5362,15 @@ gcvt_os2 (double value, int digits, char *buffer)
53625362
#undef fork
53635363
int fork_with_resources()
53645364
{
5365-
#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) && !defined(USE_SLOW_THREAD_SPECIFIC)
5365+
#if defined(USE_ITHREADS) && !defined(USE_SLOW_THREAD_SPECIFIC)
53665366
dTHX;
53675367
void *ctx = PERL_GET_CONTEXT;
53685368
#endif
53695369
unsigned fpflag = _control87(0,0);
53705370
int rc = fork();
53715371

53725372
if (rc == 0) { /* child */
5373-
#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) && !defined(USE_SLOW_THREAD_SPECIFIC)
5373+
#if defined(USE_ITHREADS) && !defined(USE_SLOW_THREAD_SPECIFIC)
53745374
ALLOC_THREAD_KEY; /* Acquire the thread-local memory */
53755375
PERL_SET_CONTEXT(ctx); /* Reinit the thread-local memory */
53765376
#endif

perl.h

-6
Original file line numberDiff line numberDiff line change
@@ -3090,12 +3090,6 @@ freeing any remaining Perl interpreters.
30903090
# endif
30913091
#endif
30923092

3093-
/* USE_5005THREADS needs to be after unixish.h as <pthread.h> includes
3094-
* <sys/signal.h> which defines NSIG - which will stop inclusion of <signal.h>
3095-
* this results in many functions being undeclared which bothers C++
3096-
* May make sense to have threads after "*ish.h" anyway
3097-
*/
3098-
30993093
/* clang Thread Safety Analysis/Annotations/Attributes
31003094
* http://clang.llvm.org/docs/ThreadSafetyAnalysis.html
31013095
*

thread.h

-5
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,7 @@
144144
*c = 0; \
145145
} STMT_END
146146

147-
#define THREAD_CREATE(thr, f) (thr->self = cthread_fork(f, thr), 0)
148-
#define THREAD_POST_CREATE(thr) NOOP
149-
150147
#define THREAD_RET_TYPE any_t
151-
#define THREAD_RET_CAST(x) ((any_t) x)
152148

153149
#define DETACH(t) cthread_detach(t->self)
154150
#define JOIN(t, avp) (*(avp) = MUTABLE_AV(cthread_join(t->self)))
@@ -363,7 +359,6 @@
363359

364360
#ifndef THREAD_RET_TYPE
365361
# define THREAD_RET_TYPE void *
366-
# define THREAD_RET_CAST(p) ((void *)(p))
367362
#endif /* THREAD_RET */
368363

369364
# define LOCK_DOLLARZERO_MUTEX MUTEX_LOCK(&PL_dollarzero_mutex)

win32/win32thread.h

-6
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ typedef HANDLE perl_mutex;
104104
} STMT_END
105105

106106

107-
#define THREAD_CREATE(t, f) Perl_thread_create(t, f)
108-
#define THREAD_POST_CREATE(t) NOOP
109-
110107
/* XXX Docs mention that the RTL versions of thread creation routines
111108
* should be used, but that advice only seems applicable when the RTL
112109
* is not in a DLL. RTL DLLs seem to do all of the init/deinit required
@@ -124,15 +121,12 @@ typedef HANDLE perl_mutex;
124121
# include <process.h>
125122
# if defined (_MSC_VER)
126123
# define THREAD_RET_TYPE unsigned __stdcall
127-
# define THREAD_RET_CAST(p) ((unsigned)(p))
128124
# else
129125
/* CRTDLL.DLL doesn't allow a return value from thread function! */
130126
# define THREAD_RET_TYPE void __cdecl
131-
# define THREAD_RET_CAST(p) ((void)(thr->i.retv = (void *)(p)))
132127
# endif
133128
#else /* !USE_RTL_THREAD_API */
134129
# define THREAD_RET_TYPE DWORD WINAPI
135-
# define THREAD_RET_CAST(p) ((DWORD)(p))
136130
#endif /* !USE_RTL_THREAD_API */
137131

138132
typedef THREAD_RET_TYPE thread_func_t(void *);

0 commit comments

Comments
 (0)