Skip to content

gh-125139: use _PyRecursiveMutex in _thread.RLock#125144

Merged
kumaraditya303 merged 14 commits into
python:mainfrom
kumaraditya303:rlock
Oct 14, 2024
Merged

gh-125139: use _PyRecursiveMutex in _thread.RLock#125144
kumaraditya303 merged 14 commits into
python:mainfrom
kumaraditya303:rlock

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

Comment thread Modules/_threadmodule.c
Comment thread Python/lock.c Outdated
Comment thread Python/lock.c Outdated
Comment thread Modules/_threadmodule.c Outdated
Comment thread Modules/_threadmodule.c Outdated
Comment thread Python/lock.c Outdated
@kumaraditya303

kumaraditya303 commented Oct 8, 2024

Copy link
Copy Markdown
Contributor Author

Current status:

  • Windows failed to build on CI but passed locally.
  • WASI failure, no idea
  • Thread sanitizer failed on CI but passes locally.

Comment thread Modules/_threadmodule.c Outdated
Comment thread Modules/_threadmodule.c Outdated
@colesbury

Copy link
Copy Markdown
Contributor

Oh, my hypothesis for the WASI failure is:

  • PyThread_get_thread_ident_ex() is zero on WASI
  • So an unlocked recursive mutex looks like it's owned by the current thread

Comment thread Modules/_threadmodule.c Outdated
Comment thread Modules/_threadmodule.c Outdated
Comment thread Python/lock.c Outdated
@kumaraditya303 kumaraditya303 merged commit 67f6e08 into python:main Oct 14, 2024
@kumaraditya303 kumaraditya303 deleted the rlock branch October 14, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants