summaryrefslogtreecommitdiffstats
path: root/Modules/threadmodule.c
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1993-01-06 13:36:38 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1993-01-06 13:36:38 (GMT)
commited59d205a94747ad57f78ae35f46837a994da8cb (patch)
tree554f575cfa4887217b826e1b96d6456246854041 /Modules/threadmodule.c
parentfea2af1e9b0c99cac6cb8806c4af651a38e92d07 (diff)
downloadcpython-ed59d205a94747ad57f78ae35f46837a994da8cb.zip
cpython-ed59d205a94747ad57f78ae35f46837a994da8cb.tar.gz
cpython-ed59d205a94747ad57f78ae35f46837a994da8cb.tar.bz2
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.
Diffstat (limited to 'Modules/threadmodule.c')
-rw-r--r--Modules/threadmodule.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c
index c2d67fc..123c4d3 100644
--- a/Modules/threadmodule.c
+++ b/Modules/threadmodule.c
@@ -47,6 +47,16 @@ extern typeobject Locktype; /* Really static, forward */
#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 @@ thread_start_new_thread(self, args)
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 @@ initthread()
/* Initialize the C thread library */
init_thread();
-
- /* Initialize the interpreter's stack save/restore mechanism */
- init_save_thread();
}