Mercurial > cpython-lru_cache-weakref
diff Modules/threadmodule.c @ 1179:9ae65ee09735 legacy-trunk
Various changes.
* Makefile: svmodule.c.proto and svgen.py are gone, svmodule.c came in
their stead. Also, pass -DUSE_DL flag to thread.c and give
the user a possibility to add the -DDEBUG to just thread.c.
* ceval.c: init_save_thread() can be called more than once now.
* svgen.py, svmodule.c.proto, svmodule.c: Removed prototype file and
replaced it by the generated file.
* thread.c: Added some more checks; added call to DL library when it
is also used to tell it where the shared arena is so that DL
can use some other area.
* threadmodule.c: Call init_save_thread from another place. Also,
added new function getlocklock() which does to lock objects
what getfilefile does to file objects.
| author | Sjoerd Mullender <sjoerd@acm.org> |
|---|---|
| date | Wed, 06 Jan 1993 13:36:38 +0000 |
| parents | a31e07847063 |
| children | 2937897a7d8b |
line wrap: on
line diff
--- a/Modules/threadmodule.c Mon Jan 04 09:16:51 1993 +0000 +++ b/Modules/threadmodule.c Wed Jan 06 13:36:38 1993 +0000 @@ -47,6 +47,16 @@ #define is_lockobject(v) ((v)->ob_type == &Locktype) +type_lock +getlocklock(lock) + object *lock; +{ + if (lock == NULL || !is_lockobject(lock)) + return NULL; + else + return ((lockobject *) lock)->lock_lock; +} + static lockobject * newlockobject() { @@ -204,6 +214,8 @@ if (!getargs(args, "(OO)", &func, &arg)) return NULL; INCREF(args); + /* Initialize the interpreter's stack save/restore mechanism */ + init_save_thread(); if (!start_new_thread(t_bootstrap, (void*) args)) { DECREF(args); err_setstr(ThreadError, "can't start new thread\n"); @@ -282,7 +294,4 @@ /* Initialize the C thread library */ init_thread(); - - /* Initialize the interpreter's stack save/restore mechanism */ - init_save_thread(); }
