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
99fcc616
Unverified
Kaydet (Commit)
99fcc616
authored
Nis 29, 2019
tarafından
Victor Stinner
Kaydeden (comit)
GitHub
Nis 29, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert "bpo-36356: Destroy the GIL at exit (GH-12453)" (GH613006)
This reverts commit
b36e5d62
.
üst
b36e5d62
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
26 deletions
+18
-26
ceval.h
Include/ceval.h
+3
-0
pycore_ceval.h
Include/internal/pycore_ceval.h
+0
-3
main.c
Modules/main.c
+5
-6
ceval.c
Python/ceval.c
+5
-11
pylifecycle.c
Python/pylifecycle.c
+5
-6
No files found.
Include/ceval.h
Dosyayı görüntüle @
99fcc616
...
...
@@ -192,6 +192,9 @@ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
PyAPI_FUNC
(
int
)
PyEval_ThreadsInitialized
(
void
);
PyAPI_FUNC
(
void
)
PyEval_InitThreads
(
void
);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
void
)
_PyEval_FiniThreads
(
void
);
#endif
/* !Py_LIMITED_API */
PyAPI_FUNC
(
void
)
PyEval_AcquireLock
(
void
)
Py_DEPRECATED
(
3
.
2
);
PyAPI_FUNC
(
void
)
PyEval_ReleaseLock
(
void
)
/* Py_DEPRECATED(3.2) */
;
PyAPI_FUNC
(
void
)
PyEval_AcquireThread
(
PyThreadState
*
tstate
);
...
...
Include/internal/pycore_ceval.h
Dosyayı görüntüle @
99fcc616
...
...
@@ -54,9 +54,6 @@ struct _ceval_runtime_state {
PyAPI_FUNC
(
void
)
_PyEval_Initialize
(
struct
_ceval_runtime_state
*
);
PyAPI_FUNC
(
void
)
_PyEval_FiniThreads
(
void
);
PyAPI_FUNC
(
void
)
_PyEval_FiniThreads2
(
void
);
#ifdef __cplusplus
}
#endif
...
...
Modules/main.c
Dosyayı görüntüle @
99fcc616
/* Python interpreter main program */
#include "Python.h"
#include "pycore_ceval.h"
/* _PyEval_FiniThreads2() */
#include "pycore_coreconfig.h"
#include "pycore_pylifecycle.h"
#include "pycore_pymem.h"
...
...
@@ -526,15 +525,15 @@ done:
/* --- pymain_main() ---------------------------------------------- */
/* Free global variables which cannot be freed in Py_Finalize():
configuration options set before Py_Initialize() which should
remain valid after Py_Finalize(), since
Py_Initialize()-Py_Finalize() can be called multiple times. */
static
void
pymain_free
(
void
)
{
_PyImport_Fini2
();
_PyEval_FiniThreads2
();
/* Free global variables which cannot be freed in Py_Finalize():
configuration options set before Py_Initialize() which should
remain valid after Py_Finalize(), since
Py_Initialize()-Py_Finalize() can be called multiple times. */
_PyPathConfig_ClearGlobal
();
_Py_ClearStandardStreamEncoding
();
_Py_ClearArgcArgv
();
...
...
Python/ceval.c
Dosyayı görüntüle @
99fcc616
...
...
@@ -188,19 +188,8 @@ PyEval_InitThreads(void)
}
}
void
_PyEval_FiniThreads
(
void
)
{
if
(
_PyRuntime
.
ceval
.
pending
.
lock
!=
NULL
)
{
PyThread_free_lock
(
_PyRuntime
.
ceval
.
pending
.
lock
);
_PyRuntime
.
ceval
.
pending
.
lock
=
NULL
;
}
}
void
_PyEval_FiniThreads2
(
void
)
{
if
(
!
gil_created
())
{
return
;
...
...
@@ -208,6 +197,11 @@ _PyEval_FiniThreads2(void)
destroy_gil
();
assert
(
!
gil_created
());
if
(
_PyRuntime
.
ceval
.
pending
.
lock
!=
NULL
)
{
PyThread_free_lock
(
_PyRuntime
.
ceval
.
pending
.
lock
);
_PyRuntime
.
ceval
.
pending
.
lock
=
NULL
;
}
}
static
inline
void
...
...
Python/pylifecycle.c
Dosyayı görüntüle @
99fcc616
...
...
@@ -4,9 +4,8 @@
#include "Python-ast.h"
#undef Yield
/* undefine macro conflicting with <winbase.h> */
#include "pycore_ceval.h"
/* _PyEval_FiniThreads() */
#include "pycore_context.h"
#include "pycore_coreconfig.h"
#include "pycore_context.h"
#include "pycore_fileutils.h"
#include "pycore_hamt.h"
#include "pycore_pathconfig.h"
...
...
@@ -556,11 +555,12 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
return
_Py_INIT_ERR
(
"can't make first thread"
);
(
void
)
PyThreadState_Swap
(
tstate
);
/* Destroying the GIL in Py_FinalizeEx might fail when it is being
referenced from another running thread (see bpo-9901).
/* We can't call _PyEval_FiniThreads() in Py_FinalizeEx because
destroying the GIL might fail when it is being referenced from
another running thread (see issue #9901).
Instead we destroy the previously created GIL here, which ensures
that we can call Py_Initialize / Py_FinalizeEx multiple times. */
_PyEval_FiniThreads
2
();
_PyEval_FiniThreads
();
/* Auto-thread-state API */
_PyGILState_Init
(
runtime
,
interp
,
tstate
);
...
...
@@ -1357,7 +1357,6 @@ Py_FinalizeEx(void)
call_ll_exitfuncs
(
runtime
);
_PyEval_FiniThreads
();
_PyRuntime_Finalize
();
return
status
;
}
...
...
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