Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'imp' documentation does not mention that lock is re-entrant #44390

Closed
djmitche mannequin opened this issue Jan 1, 2007 · 3 comments
Closed

'imp' documentation does not mention that lock is re-entrant #44390

djmitche mannequin opened this issue Jan 1, 2007 · 3 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@djmitche
Copy link
Mannequin

djmitche mannequin commented Jan 1, 2007

BPO 1625509
Nosy @akuchling
Files
  • 1625509.patch: 1625509.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/akuchling'
    closed_at = <Date 2008-05-10.17:49:14.873>
    created_at = <Date 2007-01-01.00:22:20.000>
    labels = ['docs']
    title = "'imp' documentation does not mention that lock is re-entrant"
    updated_at = <Date 2008-05-10.17:49:14.866>
    user = 'https://bugs.python.org/djmitche'

    bugs.python.org fields:

    activity = <Date 2008-05-10.17:49:14.866>
    actor = 'akuchling'
    assignee = 'akuchling'
    closed = True
    closed_date = <Date 2008-05-10.17:49:14.873>
    closer = 'akuchling'
    components = ['Documentation']
    creation = <Date 2007-01-01.00:22:20.000>
    creator = 'djmitche'
    dependencies = []
    files = ['10258']
    hgrepos = []
    issue_num = 1625509
    keywords = ['patch']
    message_count = 3.0
    messages = ['61049', '66543', '66545']
    nosy_count = 2.0
    nosy_names = ['akuchling', 'djmitche']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1625509'
    versions = ['Python 2.5']

    @djmitche
    Copy link
    Mannequin Author

    djmitche mannequin commented Jan 1, 2007

    My reading of import.c shows that imp.{acquire,release}_lock operate in the fashion of a threading.RLock, rather than a threading.Lock. Of course, this makes sense for the use to which it's put, but it would be great to have that mentioned explicitly in the documentation. Suggestion (stolen from threading documentation):

    acquire_lock()
    Acquires the interpreter's import lock for the current thread. This lock should be used by import hooks to ensure thread-safety when importing modules. 

    Once a thread has acquired the import lock, the same thread may acquire it again without blocking; the thread must release it once for each time it has acquired it.

    On platforms without threads, this function does nothing. New in version 2.3.

    @djmitche djmitche mannequin added docs Documentation in the Doc dir labels Jan 1, 2007
    @djmitche
    Copy link
    Mannequin Author

    djmitche mannequin commented May 10, 2008

    Patch attached.

    @akuchling
    Copy link
    Member

    Applied to trunk to r62996.

    @akuchling akuchling self-assigned this May 10, 2008
    @akuchling akuchling self-assigned this May 10, 2008
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant