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
20d3fc07
Commit
20d3fc07
authored
Dec 18, 2000
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapted from a patch by Barry Scott, SF patch #102875 and SF bug
#125981: closing sockets was not thread-safe.
parent
99664e45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Modules/socketmodule.c
Modules/socketmodule.c
+4
-3
No files found.
Modules/socketmodule.c
View file @
20d3fc07
...
...
@@ -904,14 +904,15 @@ pair (host, port); the host must refer to the local host.";
static
PyObject
*
PySocketSock_close
(
PySocketSockObject
*
s
,
PyObject
*
args
)
{
SOCKET_T
fd
;
if
(
!
PyArg_ParseTuple
(
args
,
":close"
))
return
NULL
;
if
(
s
->
sock_fd
!=
-
1
)
{
if
((
fd
=
s
->
sock_fd
)
!=
-
1
)
{
s
->
sock_fd
=
-
1
;
Py_BEGIN_ALLOW_THREADS
(
void
)
SOCKETCLOSE
(
s
->
sock_
fd
);
(
void
)
SOCKETCLOSE
(
fd
);
Py_END_ALLOW_THREADS
}
s
->
sock_fd
=
-
1
;
Py_INCREF
(
Py_None
);
return
Py_None
;
}
...
...
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