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
605d55d5
Commit
605d55d5
authored
Nov 02, 2013
by
Richard Oudkerk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19478: Make choice of semaphore prefix more flexible.
parent
38946131
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
Lib/multiprocessing/process.py
Lib/multiprocessing/process.py
+8
-2
Lib/multiprocessing/synchronize.py
Lib/multiprocessing/synchronize.py
+2
-2
No files found.
Lib/multiprocessing/process.py
View file @
605d55d5
...
...
@@ -301,10 +301,16 @@ class _MainProcess(BaseProcess):
self
.
_parent_pid
=
None
self
.
_popen
=
None
self
.
_config
=
{
'authkey'
:
AuthenticationString
(
os
.
urandom
(
32
)),
'semprefix'
:
'mp'
}
'semprefix'
:
'
/
mp'
}
# Note that some versions of FreeBSD only allow named
# semaphores to have names of up to 14 characters. Therfore
# semaphores to have names of up to 14 characters. Ther
e
fore
# we choose a short prefix.
#
# On MacOSX in a sandbox it may be necessary to use a
# different prefix -- see #19478.
#
# Everything in self._config will be inherited by descendant
# processes.
_current_process
=
_MainProcess
()
...
...
Lib/multiprocessing/synchronize.py
View file @
605d55d5
...
...
@@ -115,8 +115,8 @@ class SemLock(object):
@
staticmethod
def
_make_name
():
return
'
/
%s-%s'
%
(
process
.
current_process
().
_config
[
'semprefix'
],
next
(
SemLock
.
_rand
))
return
'%s-%s'
%
(
process
.
current_process
().
_config
[
'semprefix'
],
next
(
SemLock
.
_rand
))
#
# Semaphore
...
...
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