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
63e284d3
Commit
63e284d3
authored
Oct 15, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10111: minor problems in 2.7 FILE* API docs.
parent
db949b8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
Doc/c-api/file.rst
Doc/c-api/file.rst
+15
-5
Doc/c-api/init.rst
Doc/c-api/init.rst
+1
-0
No files found.
Doc/c-api/file.rst
View file @
63e284d3
...
...
@@ -63,7 +63,7 @@ change in future releases of Python.
Return the file object associated with *p* as a :ctype:`FILE\*`.
If the caller will ever use the returned :ctype:`FILE\*` object while
the
GIL
is released it must also call the :cfunc:`PyFile_IncUseCount` and
the
:term:`GIL`
is released it must also call the :cfunc:`PyFile_IncUseCount` and
:cfunc:`PyFile_DecUseCount` functions described below as appropriate.
...
...
@@ -76,10 +76,19 @@ change in future releases of Python.
finished with the :ctype:`FILE\*`. Otherwise the file object will
never be closed by Python.
The
GIL
must be held while calling this function.
The
:term:`GIL`
must be held while calling this function.
The suggested use is to call this after :cfunc:`PyFile_AsFile` just before
you release the GIL.
The suggested use is to call this after :cfunc:`PyFile_AsFile` and before
you release the GIL::
FILE *fp = PyFile_AsFile(p);
PyFile_IncUseCount(p);
/* ... */
Py_BEGIN_ALLOW_THREADS
do_something(fp);
Py_END_ALLOW_THREADS
/* ... */
PyFile_DecUseCount(p);
.. versionadded:: 2.6
...
...
@@ -90,7 +99,8 @@ change in future releases of Python.
indicate that the caller is done with its own use of the :ctype:`FILE\*`.
This may only be called to undo a prior call to :cfunc:`PyFile_IncUseCount`.
The GIL must be held while calling this function.
The :term:`GIL` must be held while calling this function (see the example
above).
.. versionadded:: 2.6
...
...
Doc/c-api/init.rst
View file @
63e284d3
...
...
@@ -413,6 +413,7 @@ Thread State and the Global Interpreter Lock
============================================
.. index::
single: GIL
single: global interpreter lock
single: interpreter lock
single: lock, interpreter
...
...
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