Commit e944da89 authored by Guido van Rossum's avatar Guido van Rossum

ceval.c: dict of local mapping is now a tuple

compile.c: lists and dictionary in code objects become tuples
import.c: bump MAGIC
thread*.[ch]: added thread_ident() function
version.c: added '++' to version number and bumped date
parent 34162a12
...@@ -48,6 +48,12 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -48,6 +48,12 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long get_thread_ident _P0()
{
if (!initialized)
init_thread();
}
static void do_exit_thread _P1(no_cleanup, int no_cleanup) static void do_exit_thread _P1(no_cleanup, int no_cleanup)
{ {
dprintf(("exit_thread called\n")); dprintf(("exit_thread called\n"));
......
...@@ -43,6 +43,12 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -43,6 +43,12 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long get_thread_ident _P0()
{
if (!initialized)
init_thread();
}
static void do_exit_thread _P1(no_cleanup, int no_cleanup) static void do_exit_thread _P1(no_cleanup, int no_cleanup)
{ {
dprintf(("exit_thread called\n")); dprintf(("exit_thread called\n"));
......
...@@ -52,9 +52,7 @@ static void _init_thread _P0() ...@@ -52,9 +52,7 @@ static void _init_thread _P0()
int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
{ {
thread_t tid; thread_t tid;
int success = 0; /* init not needed when SOLARIS_THREADS and */ int success;
/* C_THREADS implemented properly */
dprintf(("start_new_thread called\n")); dprintf(("start_new_thread called\n"));
if (!initialized) if (!initialized)
init_thread(); init_thread();
...@@ -62,6 +60,16 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -62,6 +60,16 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long get_thread_ident _P0()
{
thread_t tid;
if (!initialized)
init_thread();
if (lwp_self(&tid) < 0)
return -1;
return tid.thread_id;
}
static void do_exit_thread _P1(no_cleanup, int no_cleanup) static void do_exit_thread _P1(no_cleanup, int no_cleanup)
{ {
dprintf(("exit_thread called\n")); dprintf(("exit_thread called\n"));
......
...@@ -83,9 +83,7 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -83,9 +83,7 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
static int local_initialized = 0; static int local_initialized = 0;
#endif /* SGI_THREADS and USE_DL */ #endif /* SGI_THREADS and USE_DL */
pthread_t th; pthread_t th;
int success = 0; /* init not needed when SOLARIS_THREADS and */ int success;
/* C_THREADS implemented properly */
dprintf(("start_new_thread called\n")); dprintf(("start_new_thread called\n"));
if (!initialized) if (!initialized)
init_thread(); init_thread();
...@@ -93,6 +91,13 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -93,6 +91,13 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long get_thread_ident _P0()
{
if (!initialized)
init_thread();
return (long) pthread_self();
}
static void do_exit_thread _P1(no_cleanup, int no_cleanup) static void do_exit_thread _P1(no_cleanup, int no_cleanup)
{ {
dprintf(("exit_thread called\n")); dprintf(("exit_thread called\n"));
......
...@@ -229,6 +229,11 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -229,6 +229,11 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long get_thread_ident _P0()
{
return getpid();
}
static void do_exit_thread _P1(no_cleanup, int no_cleanup) static void do_exit_thread _P1(no_cleanup, int no_cleanup)
{ {
dprintf(("exit_thread called\n")); dprintf(("exit_thread called\n"));
......
...@@ -76,6 +76,13 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -76,6 +76,13 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
return success < 0 ? 0 : 1; return success < 0 ? 0 : 1;
} }
long get_thread_ident _P0()
{
if (!initialized)
init_thread();
return thr_self();
}
static void do_exit_thread _P1(no_cleanup, int no_cleanup) static void do_exit_thread _P1(no_cleanup, int no_cleanup)
{ {
dprintf(("exit_thread called\n")); dprintf(("exit_thread called\n"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment