Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
aee8bc1f
Kaydet (Commit)
aee8bc1f
authored
Eyl 02, 1992
tarafından
Sjoerd Mullender
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
adapted SV module to the new svideo library.
update thread package.
üst
e0be2b36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
thread.c
Python/thread.c
+91
-0
No files found.
Python/thread.c
Dosyayı görüntüle @
aee8bc1f
#include "thread.h"
<<<<<<<
thread
.
c
#ifndef DEBUG
#define DEBUG
#endif
#ifdef DEBUG
#define dprintf(args) printf args
#else
#define dprintf(args)
#endif
=======
#ifdef DEBUG
#define dprintf(args) printf args
#else
#define dprintf(args)
#endif
>>>>>>>
2
.
3
#ifdef __sgi
#include <stdlib.h>
#include <stdio.h>
...
...
@@ -59,6 +72,83 @@ struct lock {
static
int
initialized
;
<<<<<<<
thread
.
c
#ifdef __sgi
/*
* This routine is called as a signal handler when another thread
* exits. When that happens, we must see whether we have to exit as
* well (because of an exit_prog()) or whether we should continue on.
*/
static
void
exit_sig
_P0
()
{
dprintf
((
"exit_sig called
\n
"
));
if
(
exiting
&&
getpid
()
==
my_pid
)
{
dprintf
((
"already exiting
\n
"
));
return
;
}
if
(
do_exit
)
{
dprintf
((
"exiting in exit_sig
\n
"
));
exit_thread
();
}
}
/*
* This routine is called when a process calls exit(). If that wasn't
* done from the library, we do as if an exit_prog() was intended.
*/
static
void
maybe_exit
_P0
()
{
dprintf
((
"maybe_exit called
\n
"
));
if
(
exiting
)
{
dprintf
((
"already exiting
\n
"
));
return
;
}
exit_prog
(
0
);
}
#endif
/*
* Initialization.
*/
void
init_thread
_P0
()
{
#ifdef __sgi
struct
sigaction
s
;
#endif
dprintf
((
"init_thread called
\n
"
));
if
(
initialized
)
return
;
initialized
=
1
;
#ifdef __sgi
my_pid
=
getpid
();
/* so that we know which is the main thread */
atexit
(
maybe_exit
);
s
.
sa_handler
=
exit_sig
;
sigemptyset
(
&
s
.
sa_mask
);
sigaddset
(
&
s
.
sa_mask
,
SIGUSR1
);
s
.
sa_flags
=
0
;
sigaction
(
SIGUSR1
,
&
s
,
0
);
prctl
(
PR_SETEXITSIG
,
SIGUSR1
);
usconfig
(
CONF_ARENATYPE
,
US_SHAREDONLY
);
/*usconfig(CONF_LOCKTYPE, US_DEBUGPLUS);*/
shared_arena
=
usinit
(
tmpnam
(
0
));
count_lock
=
usnewlock
(
shared_arena
);
(
void
)
usinitlock
(
count_lock
);
wait_lock
=
usnewlock
(
shared_arena
);
#endif
#ifdef sun
lwp_setstkcache
(
STACKSIZE
,
NSTACKS
);
#endif
#ifdef C_THREADS
cthread_init
();
#endif
}
/*
* Thread support.
*/
=======
#ifdef __sgi
/*
* This routine is called as a signal handler when another thread
...
...
@@ -134,6 +224,7 @@ void init_thread _P0()
/*
* Thread support.
*/
>>>>>>>
2
.
3
int
start_new_thread
_P2
(
func
,
void
(
*
func
)
_P
((
void
*
)),
arg
,
void
*
arg
)
{
#ifdef sun
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment