]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
ceval.c: dict of local mapping is now a tuple
authorGuido van Rossum <guido@python.org>
Mon, 23 May 1994 12:43:41 +0000 (12:43 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 23 May 1994 12:43:41 +0000 (12:43 +0000)
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

Python/thread_cthread.h
Python/thread_foobar.h
Python/thread_lwp.h
Python/thread_pthread.h
Python/thread_sgi.h
Python/thread_solaris.h

index c56bf0d959d614bea26db9dcb55b9a62f7d5e6ed..bf9a0249ebd2f783f7a27473e07745ce1a772818 100644 (file)
@@ -48,6 +48,12 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
        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)
 {
        dprintf(("exit_thread called\n"));
index 492096aa68e85133a848ab23121090d73c5c123f..4b767b1e9508b91c2636fa012d996c946bfc4654 100644 (file)
@@ -43,6 +43,12 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
        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)
 {
        dprintf(("exit_thread called\n"));
index b28e602d930c35cb931d1558be8ccd4573f79b94..ab59ccd274f2e56dbfe5255c417cf2685dfea97b 100644 (file)
@@ -52,9 +52,7 @@ static void _init_thread _P0()
 int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
 {
        thread_t tid;
-       int success = 0;        /* init not needed when SOLARIS_THREADS and */
-                               /* C_THREADS implemented properly */
-
+       int success;
        dprintf(("start_new_thread called\n"));
        if (!initialized)
                init_thread();
@@ -62,6 +60,16 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
        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)
 {
        dprintf(("exit_thread called\n"));
index 1d539eea6366fe5d2bef6111d84a55f4c8dd4f78..c5d7be4d88c727f25bbd6bbd925ea25798614214 100644 (file)
@@ -83,9 +83,7 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
        static int local_initialized = 0;
 #endif /* SGI_THREADS and USE_DL */
        pthread_t th;
-       int success = 0;        /* init not needed when SOLARIS_THREADS and */
-                               /* C_THREADS implemented properly */
-
+       int success;
        dprintf(("start_new_thread called\n"));
        if (!initialized)
                init_thread();
@@ -93,6 +91,13 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
        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)
 {
        dprintf(("exit_thread called\n"));
index 6f6334e5349211950f2b407ab542517750135487..40f28a04681a9295a793e3def4a81b74d6a54d13 100644 (file)
@@ -229,6 +229,11 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
        return success < 0 ? 0 : 1;
 }
 
+long get_thread_ident _P0()
+{
+       return getpid();
+}
+
 static void do_exit_thread _P1(no_cleanup, int no_cleanup)
 {
        dprintf(("exit_thread called\n"));
index 08cf6dd05190e40ca443a0ab5b88f1a150917693..8bbbeb09da565854c96d13f8c3dbec045fd5bd45 100644 (file)
@@ -76,6 +76,13 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
        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)
 {
        dprintf(("exit_thread called\n"));