Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#639 Deadlock with Loader Lock and GIL

open
nobody
None
5
2013-04-29
2013-04-29
Stefan Schukat
No

FormatMessage could implicit load libraries to read resource strings for the message formatting. For this the windows DLL loader lock is acquired. In an multithreaded application which makes use of native an Python threads a deadlock could happen if these two locks (Loader Lock, GIL) are acquired in wrong order. This fix releases the GIL before a call to FormatMessage is made.

Discussion

  • Stefan Schukat
    Stefan Schukat
    2013-04-29

    Patch to fix loader lock GIL problem.

     
  • Mark Hammond
    Mark Hammond
    2013-04-30

    This patch looks fine, but could you please remove the lines like "// code changed by ssc" - source control can tell us that (and if you upload a patch from a mercurial queue, you will be directly attributed for the change)

    Thanks!

     
  • Stefan Schukat
    Stefan Schukat
    2013-04-30

    I provided a patch in the patch queue with the changes suggested.