mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
fea2af1e9b
commit
ed59d205a9
4 changed files with 979 additions and 9 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue