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
8fdc75ba
Commit
8fdc75ba
authored
Apr 07, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lock methods acquire() and locked() now return bools.
parent
7f7666ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Modules/threadmodule.c
Modules/threadmodule.c
+7
-7
No files found.
Modules/threadmodule.c
View file @
8fdc75ba
...
@@ -68,17 +68,17 @@ lock_PyThread_acquire_lock(lockobject *self, PyObject *args)
...
@@ -68,17 +68,17 @@ lock_PyThread_acquire_lock(lockobject *self, PyObject *args)
return
Py_None
;
return
Py_None
;
}
}
else
else
return
Py
Int
_FromLong
((
long
)
i
);
return
Py
Bool
_FromLong
((
long
)
i
);
}
}
static
char
acquire_doc
[]
=
static
char
acquire_doc
[]
=
"acquire([wait]) -> None or
Boolean
\n
\
"acquire([wait]) -> None or
bool
\n
\
(PyThread_acquire_lock() is an obsolete synonym)
\n
\
(PyThread_acquire_lock() is an obsolete synonym)
\n
\
\n
\
\n
\
Lock the lock. Without argument, this blocks if the lock is already
\n
\
Lock the lock. Without argument, this blocks if the lock is already
\n
\
locked (even by the same thread), waiting for another thread to release
\n
\
locked (even by the same thread), waiting for another thread to release
\n
\
the lock, and return None
when
the lock is acquired.
\n
\
the lock, and return None
once
the lock is acquired.
\n
\
With a
Boolea
n argument, this will only block if the argument is true,
\n
\
With an argument, this will only block if the argument is true,
\n
\
and the return value reflects whether the lock is acquired.
\n
\
and the return value reflects whether the lock is acquired.
\n
\
The blocking operation is not interruptible."
;
The blocking operation is not interruptible."
;
...
@@ -110,13 +110,13 @@ lock_locked_lock(lockobject *self)
...
@@ -110,13 +110,13 @@ lock_locked_lock(lockobject *self)
{
{
if
(
PyThread_acquire_lock
(
self
->
lock_lock
,
0
))
{
if
(
PyThread_acquire_lock
(
self
->
lock_lock
,
0
))
{
PyThread_release_lock
(
self
->
lock_lock
);
PyThread_release_lock
(
self
->
lock_lock
);
return
Py
Int
_FromLong
(
0L
);
return
Py
Bool
_FromLong
(
0L
);
}
}
return
Py
Int
_FromLong
(
1L
);
return
Py
Bool
_FromLong
(
1L
);
}
}
static
char
locked_doc
[]
=
static
char
locked_doc
[]
=
"locked() ->
Boolean
\n
\
"locked() ->
bool
\n
\
(locked_lock() is an obsolete synonym)
\n
\
(locked_lock() is an obsolete synonym)
\n
\
\n
\
\n
\
Return whether the lock is in the locked state."
;
Return whether the lock is in the locked state."
;
...
...
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