annotate Python/getcompiler.c @ 33940:dfd07b7be407 legacy-trunk

SF bug 1061968: threads: segfault or Py_FatalError at exit PyGILState_Ensure(): The fix in 2.4a3 for bug 1010677 reintroduced thread shutdown race bug 225673. Repaired by (once again) ensuring the GIL is held whenever deleting a thread state. Alas, there's no useful test case for this shy bug. Four years ago, only Guido could provoke it, on his box, and today only Armin can provoke it on his box. I've never been able to provoke it (but not for lack of trying!). This is a critical fix for 2.3.5 too, since the fix for 1010677 got backported there already and so also reintroduced 225673. I don't intend to backport this fix. For whoever (if anyone) does, there are other thread fixes in 2.4 that need backporting too, and I bet they need to happen first for this patch to apply cleanly.
author Tim Peters <tim.peters@gmail.com>
date Mon, 08 Nov 2004 04:30:21 +0000
parents 4306107b1395
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3589
bd20c04274ff Added copyright.
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
1
3621
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3589
diff changeset
2 /* Return the compiler identification, if possible. */
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3589
diff changeset
3
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3589
diff changeset
4 #include "Python.h"
3589
bd20c04274ff Added copyright.
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
5
bd20c04274ff Added copyright.
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
6 #ifndef COMPILER
3621
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3589
diff changeset
7
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 #ifdef __GNUC__
14410
4306107b1395 The GCC version is loooooooooong; put it on a new line.
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
9 #define COMPILER "\n[GCC " __VERSION__ "]"
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 #endif
3621
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3589
diff changeset
11
3589
bd20c04274ff Added copyright.
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
12 #endif /* !COMPILER */
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
13
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 #ifndef COMPILER
3621
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3589
diff changeset
15
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 #ifdef __cplusplus
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 #define COMPILER "[C++]"
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 #else
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 #define COMPILER "[C]"
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 #endif
3621
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3589
diff changeset
21
3589
bd20c04274ff Added copyright.
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
22 #endif /* !COMPILER */
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
23
5860
728a083242a2 Make it return a _const_ char*.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
24 const char *
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13256
diff changeset
25 Py_GetCompiler(void)
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 {
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 return COMPILER;
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 }