[issue10393] "with" statement isn't thread-safe

2010-11-12 Thread Abyx
Abyx added the comment: Thanks. -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue10393] "with" statement isn't thread-safe

2010-11-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Agreed. There was a similar issue in python2.6 with list comprehensions. The issue is that both threads run the code with the same globals dictionary, and top-level code use the same dict for locals and globals. This is already fixed in 2.7 and 3.2, temp

[issue10393] "with" statement isn't thread-safe

2010-11-12 Thread Abyx
New submission from Abyx : Code to reproduce the bug: #include #include DWORD WINAPI thread_fn(void* code) { PyGILState_STATE state = PyGILState_Ensure(); PyRun_SimpleString("with sync: print('.')\n"); PyGILState_Release(state); return 0; } int main() {