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
e3422fae
Kaydet (Commit)
e3422fae
authored
Ock 12, 2009
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #4893: Use NT threading on CE.
üst
1b3bef21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
NEWS
Misc/NEWS
+2
-0
thread.c
Python/thread.c
+0
-4
thread_nt.h
Python/thread_nt.h
+26
-3
No files found.
Misc/NEWS
Dosyayı görüntüle @
e3422fae
...
@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
...
@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #4893: Use NT threading on CE.
- Issue #4915: Port sysmodule to Windows CE.
- Issue #4915: Port sysmodule to Windows CE.
- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
...
...
Python/thread.c
Dosyayı görüntüle @
e3422fae
...
@@ -137,10 +137,6 @@ static size_t _pythread_stacksize = 0;
...
@@ -137,10 +137,6 @@ static size_t _pythread_stacksize = 0;
#include "thread_beos.h"
#include "thread_beos.h"
#endif
#endif
#ifdef WINCE_THREADS
#include "thread_wince.h"
#endif
#ifdef PLAN9_THREADS
#ifdef PLAN9_THREADS
#include "thread_plan9.h"
#include "thread_plan9.h"
#endif
#endif
...
...
Python/thread_nt.h
Dosyayı görüntüle @
e3422fae
...
@@ -106,8 +106,13 @@ typedef struct {
...
@@ -106,8 +106,13 @@ typedef struct {
void
*
arg
;
void
*
arg
;
}
callobj
;
}
callobj
;
/* thunker to call a __cdecl function instead of a __stdcall */
/* thunker to call adapt between the function type used by the system's
thread start function and the internally used one. */
#if defined(MS_WINCE)
static
DWORD
WINAPI
#else
static
unsigned
__stdcall
static
unsigned
__stdcall
#endif
bootstrap
(
void
*
call
)
bootstrap
(
void
*
call
)
{
{
callobj
*
obj
=
(
callobj
*
)
call
;
callobj
*
obj
=
(
callobj
*
)
call
;
...
@@ -135,24 +140,38 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
...
@@ -135,24 +140,38 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
return
-
1
;
return
-
1
;
obj
->
func
=
func
;
obj
->
func
=
func
;
obj
->
arg
=
arg
;
obj
->
arg
=
arg
;
#if defined(MS_WINCE)
hThread
=
CreateThread
(
NULL
,
Py_SAFE_DOWNCAST
(
_pythread_stacksize
,
Py_ssize_t
,
SIZE_T
),
bootstrap
,
obj
,
0
,
&
threadID
);
#else
hThread
=
(
HANDLE
)
_beginthreadex
(
0
,
hThread
=
(
HANDLE
)
_beginthreadex
(
0
,
Py_SAFE_DOWNCAST
(
_pythread_stacksize
,
Py_SAFE_DOWNCAST
(
_pythread_stacksize
,
Py_ssize_t
,
unsigned
int
),
Py_ssize_t
,
unsigned
int
),
bootstrap
,
obj
,
bootstrap
,
obj
,
0
,
&
threadID
);
0
,
&
threadID
);
#endif
if
(
hThread
==
0
)
{
if
(
hThread
==
0
)
{
#if defined(MS_WINCE)
/* Save error in variable, to prevent PyThread_get_thread_ident
from clobbering it. */
unsigned
e
=
GetLastError
();
dprintf
((
"%ld: PyThread_start_new_thread failed, win32 error code %u
\n
"
,
PyThread_get_thread_ident
(),
e
));
#else
/* I've seen errno == EAGAIN here, which means "there are
/* I've seen errno == EAGAIN here, which means "there are
* too many threads".
* too many threads".
*/
*/
int
e
=
errno
;
dprintf
((
"%ld: PyThread_start_new_thread failed, errno %d
\n
"
,
dprintf
((
"%ld: PyThread_start_new_thread failed, errno %d
\n
"
,
PyThread_get_thread_ident
(),
errno
));
PyThread_get_thread_ident
(),
e
));
#endif
threadID
=
(
unsigned
)
-
1
;
threadID
=
(
unsigned
)
-
1
;
HeapFree
(
GetProcessHeap
(),
0
,
obj
);
HeapFree
(
GetProcessHeap
(),
0
,
obj
);
}
}
else
{
else
{
dprintf
((
"%ld: PyThread_start_new_thread succeeded: %p
\n
"
,
dprintf
((
"%ld: PyThread_start_new_thread succeeded: %p
\n
"
,
PyThread_get_thread_ident
(),
(
void
*
)
hThread
));
PyThread_get_thread_ident
(),
(
void
*
)
hThread
));
/* wait for thread to initialize, so we can get its id */
CloseHandle
(
hThread
);
CloseHandle
(
hThread
);
}
}
return
(
long
)
threadID
;
return
(
long
)
threadID
;
...
@@ -177,7 +196,11 @@ PyThread_exit_thread(void)
...
@@ -177,7 +196,11 @@ PyThread_exit_thread(void)
dprintf
((
"%ld: PyThread_exit_thread called
\n
"
,
PyThread_get_thread_ident
()));
dprintf
((
"%ld: PyThread_exit_thread called
\n
"
,
PyThread_get_thread_ident
()));
if
(
!
initialized
)
if
(
!
initialized
)
exit
(
0
);
exit
(
0
);
#if defined(MS_WINCE)
ExitThread
(
0
);
#else
_endthreadex
(
0
);
_endthreadex
(
0
);
#endif
}
}
#ifndef NO_EXIT_PROG
#ifndef NO_EXIT_PROG
...
...
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