? ABOUT-NLS ? config.rpath ? m4 ? mkinstalldirs ? po/Makefile ? po/Makefile.in ? po/Makefile.in.in ? po/Makevars.template ? po/POTFILES ? po/Rules-quot ? po/boldquot.sed ? po/en@boldquot.header ? po/en@quot.header ? po/en_GB.gmo ? po/insert-header.sin ? po/quot.sed ? po/remove-potcdate.sin ? po/stamp-po ? tests/reconnect Index: python/generator.py =================================================================== RCS file: /data/cvs/libvirt/python/generator.py,v retrieving revision 1.10 diff -r1.10 generator.py 424c424,425 < --- > > output.write("libvirt_begin_allow_threads;\n"); 425a427 > output.write("libvirt_end_allow_threads;\n"); Index: python/libvir.c =================================================================== RCS file: /data/cvs/libvirt/python/libvir.c,v retrieving revision 1.13 diff -r1.13 libvir.c 20a21,22 > > 42a45,46 > libvirt_ensure_thread_state; > 65a70,71 > > libvirt_release_thread_state; 126a133 > libvirt_begin_allow_threads; 127a135 > libvirt_end_allow_threads; 142a151 > libvirt_begin_allow_threads; 143a153 > libvirt_end_allow_threads; 160a171 > libvirt_begin_allow_threads; 161a173 > libvirt_end_allow_threads; 184a197 > libvirt_begin_allow_threads; 185a199 > libvirt_end_allow_threads; 211a226 > libvirt_begin_allow_threads; 212a228 > libvirt_end_allow_threads; 234a251 > int c_retval; 244c261,265 < if (virDomainGetUUID(domain, &uuid[0]) < 0) { --- > libvirt_begin_allow_threads; > c_retval = virDomainGetUUID(domain, &uuid[0]); > libvirt_end_allow_threads; > > if (c_retval < 0) { 270a292 > libvirt_begin_allow_threads; 271a294 > libvirt_end_allow_threads; Index: python/libvirt_wrap.h =================================================================== RCS file: /data/cvs/libvirt/python/libvirt_wrap.h,v retrieving revision 1.3 diff -r1.3 libvirt_wrap.h 50a51,102 > extern int libvirt_threads_enabled; > > > /* Provide simple macro statement wrappers (adapted from Perl): > * LIBVIRT_STMT_START { statements; } LIBVIRT_STMT_END; > * can be used as a single statement, as in > * if (x) LIBVIRT_STMT_START { ... } LIBVIRT_STMT_END; else ... > * > * When GCC is compiling C code in non-ANSI mode, it will use the > * compiler __extension__ to wrap the statements wihin `({' and '})' braces. > * When compiling on platforms where configure has defined > * HAVE_DOWHILE_MACROS, statements will be wrapped with `do' and `while (0)'. > * For any other platforms (SunOS4 is known to have this issue), wrap the > * statements with `if (1)' and `else (void) 0'. > */ > #if !(defined (LIBVIRT_STMT_START) && defined (LIBVIRT_STMT_END)) > # if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) > # define LIBVIRT_STMT_START (void) __extension__ ( > # define LIBVIRT_STMT_END ) > # else /* !(__GNUC__ && !__STRICT_ANSI__ && !__cplusplus) */ > # if defined (HAVE_DOWHILE_MACROS) > # define LIBVIRT_STMT_START do > # define LIBVIRT_STMT_END while (0) > # else /* !HAVE_DOWHILE_MACROS */ > # define LIBVIRT_STMT_START if (1) > # define LIBVIRT_STMT_END else (void) 0 > # endif /* !HAVE_DOWHILE_MACROS */ > # endif /* !(__GNUC__ && !__STRICT_ANSI__ && !__cplusplus) */ > #endif > > #define libvirt_begin_allow_threads \ > LIBVIRT_STMT_START { \ > PyThreadState *_save = NULL; \ > if (PyEval_ThreadsInitialized()) \ > _save = PyEval_SaveThread(); > > #define libvirt_end_allow_threads \ > if (PyEval_ThreadsInitialized()) \ > PyEval_RestoreThread(_save); \ > } LIBVIRT_STMT_END > > #define libvirt_ensure_thread_state \ > LIBVIRT_STMT_START { \ > PyGILState_STATE _save; \ > if (PyEval_ThreadsInitialized()) \ > _save = PyGILState_Ensure(); > > #define libvirt_release_thread_state \ > if (PyEval_ThreadsInitialized()) \ > PyGILState_Release(_save); \ > } LIBVIRT_STMT_END >