Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
fe51a1f2
Commit
fe51a1f2
authored
Oct 09, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rollback the merge of r74524 because it causes failures in test_multiprocessing
parent
c70614fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
10 deletions
+2
-10
Doc/library/weakref.rst
Doc/library/weakref.rst
+0
-3
Modules/_threadmodule.c
Modules/_threadmodule.c
+2
-7
No files found.
Doc/library/weakref.rst
View file @
fe51a1f2
...
...
@@ -61,9 +61,6 @@ instances, functions written in Python (but not in C), instance methods, sets,
frozensets, file objects, :term:`generator`\s, type objects, sockets, arrays,
deques, and regular expression pattern objects.
.. versionchanged:: 2.7
Added support for thread.lock and threading.Lock.
Several built-in types such as :class:`list` and :class:`dict` do not directly
support weak references but can add support through subclassing::
...
...
Modules/_threadmodule.c
View file @
fe51a1f2
...
...
@@ -3,7 +3,6 @@
/* Interface to Sjoerd's portable C thread library */
#include "Python.h"
#include "structmember.h"
/* offsetof */
#ifndef WITH_THREAD
#error "Error! The rest of Python is not compiled with thread support."
...
...
@@ -21,15 +20,12 @@ static PyObject *ThreadError;
typedef
struct
{
PyObject_HEAD
PyThread_type_lock
lock_lock
;
PyObject
*
in_weakreflist
;
}
lockobject
;
static
void
lock_dealloc
(
lockobject
*
self
)
{
assert
(
self
->
lock_lock
);
if
(
self
->
in_weakreflist
!=
NULL
)
PyObject_ClearWeakRefs
((
PyObject
*
)
self
);
/* Unlock the lock so it's safe to free it */
PyThread_acquire_lock
(
self
->
lock_lock
,
0
);
PyThread_release_lock
(
self
->
lock_lock
);
...
...
@@ -144,12 +140,12 @@ static PyTypeObject Locktype = {
0
,
/*tp_getattro*/
0
,
/*tp_setattro*/
0
,
/*tp_as_buffer*/
Py_TPFLAGS_DEFAULT
,
/*tp_flags*/
Py_TPFLAGS_DEFAULT
,
/*tp_flags*/
0
,
/*tp_doc*/
0
,
/*tp_traverse*/
0
,
/*tp_clear*/
0
,
/*tp_richcompare*/
offsetof
(
lockobject
,
in_weakreflist
),
/*tp_weaklistoffset*/
0
,
/*tp_weaklistoffset*/
0
,
/*tp_iter*/
0
,
/*tp_iternext*/
lock_methods
,
/*tp_methods*/
...
...
@@ -163,7 +159,6 @@ newlockobject(void)
if
(
self
==
NULL
)
return
NULL
;
self
->
lock_lock
=
PyThread_allocate_lock
();
self
->
in_weakreflist
=
NULL
;
if
(
self
->
lock_lock
==
NULL
)
{
PyObject_Del
(
self
);
self
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment