Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2179945

Browse files
newest version
1 parent aee8bc1 commit 2179945

1 file changed

Lines changed: 0 additions & 91 deletions

File tree

Python/thread.c

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
#include "thread.h"
22

3-
<<<<<<< thread.c
4-
#ifndef DEBUG
5-
#define DEBUG
6-
#endif
7-
83
#ifdef DEBUG
94
#define dprintf(args) printf args
105
#else
116
#define dprintf(args)
127
#endif
138

14-
=======
15-
#ifdef DEBUG
16-
#define dprintf(args) printf args
17-
#else
18-
#define dprintf(args)
19-
#endif
20-
21-
>>>>>>> 2.3
229
#ifdef __sgi
2310
#include <stdlib.h>
2411
#include <stdio.h>
@@ -72,7 +59,6 @@ struct lock {
7259

7360
static int initialized;
7461

75-
<<<<<<< thread.c
7662
#ifdef __sgi
7763
/*
7864
* This routine is called as a signal handler when another thread
@@ -148,83 +134,6 @@ void init_thread _P0()
148134
/*
149135
* Thread support.
150136
*/
151-
=======
152-
#ifdef __sgi
153-
/*
154-
* This routine is called as a signal handler when another thread
155-
* exits. When that happens, we must see whether we have to exit as
156-
* well (because of an exit_prog()) or whether we should continue on.
157-
*/
158-
static void exit_sig _P0()
159-
{
160-
dprintf(("exit_sig called\n"));
161-
if (exiting && getpid() == my_pid) {
162-
dprintf(("already exiting\n"));
163-
return;
164-
}
165-
if (do_exit) {
166-
dprintf(("exiting in exit_sig\n"));
167-
exit_thread();
168-
}
169-
}
170-
171-
/*
172-
* This routune is called when a process calls exit(). If that wasn't
173-
* done from the library, we do as if an exit_prog() was intended.
174-
*/
175-
static void maybe_exit _P0()
176-
{
177-
dprintf(("maybe_exit called\n"));
178-
if (exiting) {
179-
dprintf(("already exiting\n"));
180-
return;
181-
}
182-
exit_prog(0);
183-
}
184-
#endif
185-
186-
/*
187-
* Initialization.
188-
*/
189-
void init_thread _P0()
190-
{
191-
#ifdef __sgi
192-
struct sigaction s;
193-
#endif
194-
195-
dprintf(("init_thread called\n"));
196-
if (initialized)
197-
return;
198-
initialized = 1;
199-
200-
#ifdef __sgi
201-
my_pid = getpid(); /* so that we know which is the main thread */
202-
atexit(maybe_exit);
203-
s.sa_handler = exit_sig;
204-
sigemptyset(&s.sa_mask);
205-
sigaddset(&s.sa_mask, SIGUSR1);
206-
s.sa_flags = 0;
207-
sigaction(SIGUSR1, &s, 0);
208-
prctl(PR_SETEXITSIG, SIGUSR1);
209-
usconfig(CONF_ARENATYPE, US_SHAREDONLY);
210-
/*usconfig(CONF_LOCKTYPE, US_DEBUGPLUS);*/
211-
shared_arena = usinit(tmpnam(0));
212-
count_lock = usnewlock(shared_arena);
213-
(void) usinitlock(count_lock);
214-
wait_lock = usnewlock(shared_arena);
215-
#endif
216-
#ifdef sun
217-
lwp_setstkcache(STACKSIZE, NSTACKS);
218-
#endif
219-
#ifdef C_THREADS
220-
cthread_init();
221-
#endif
222-
}
223-
224-
/*
225-
* Thread support.
226-
*/
227-
>>>>>>> 2.3
228137
int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
229138
{
230139
#ifdef sun

0 commit comments

Comments
 (0)