Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Side by Side Diff: Python/thread.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Python/symtable.c ('k') | Python/thread_cthread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Thread package. 2 /* Thread package.
3 This is intended to be usable independently from Python. 3 This is intended to be usable independently from Python.
4 The implementation for system foobar is in a file thread_foobar.h 4 The implementation for system foobar is in a file thread_foobar.h
5 which is included by this file dependent on config settings. 5 which is included by this file dependent on config settings.
6 Stuff shared by all thread_*.h files is collected here. */ 6 Stuff shared by all thread_*.h files is collected here. */
7 7
8 #include "Python.h" 8 #include "Python.h"
9 9
10 #ifndef _POSIX_THREADS 10 #ifndef _POSIX_THREADS
11 /* This means pthreads are not implemented in libc headers, hence the macro 11 /* This means pthreads are not implemented in libc headers, hence the macro
12 not present in unistd.h. But they still can be implemented as an external 12 not present in unistd.h. But they still can be implemented as an external
13 library (e.g. gnu pth in pthread emulation) */ 13 library (e.g. gnu pth in pthread emulation) */
14 # ifdef HAVE_PTHREAD_H 14 # ifdef HAVE_PTHREAD_H
15 # include <pthread.h> /* _POSIX_THREADS */ 15 # include <pthread.h> /* _POSIX_THREADS */
16 # endif 16 # endif
17 #endif 17 #endif
18 18
19 #ifndef DONT_HAVE_STDIO_H 19 #ifndef DONT_HAVE_STDIO_H
20 #include <stdio.h> 20 #include <stdio.h>
21 #endif 21 #endif
22 22
23 #include <stdlib.h> 23 #include <stdlib.h>
24 24
25 #include "pythread.h" 25 #include "pythread.h"
26 26
27 #ifndef _POSIX_THREADS 27 #ifndef _POSIX_THREADS
28
29 #ifdef __sgi
30 #define SGI_THREADS
31 #endif
32
33 #ifdef HAVE_THREAD_H
34 #define SOLARIS_THREADS
35 #endif
36
37 #if defined(sun) && !defined(SOLARIS_THREADS)
38 #define SUN_LWP
39 #endif
28 40
29 /* Check if we're running on HP-UX and _SC_THREADS is defined. If so, then 41 /* Check if we're running on HP-UX and _SC_THREADS is defined. If so, then
30 enough of the Posix threads package is implemented to support python 42 enough of the Posix threads package is implemented to support python
31 threads. 43 threads.
32 44
33 This is valid for HP-UX 11.23 running on an ia64 system. If needed, add 45 This is valid for HP-UX 11.23 running on an ia64 system. If needed, add
34 a check of __ia64 to verify that we're running on a ia64 system instead 46 a check of __ia64 to verify that we're running on a ia64 system instead
35 of a pa-risc system. 47 of a pa-risc system.
36 */ 48 */
37 #ifdef __hpux 49 #ifdef __hpux
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return; 85 return;
74 initialized = 1; 86 initialized = 1;
75 dprintf(("PyThread_init_thread called\n")); 87 dprintf(("PyThread_init_thread called\n"));
76 PyThread__init_thread(); 88 PyThread__init_thread();
77 } 89 }
78 90
79 /* Support for runtime thread stack size tuning. 91 /* Support for runtime thread stack size tuning.
80 A value of 0 means using the platform's default stack size 92 A value of 0 means using the platform's default stack size
81 or the size specified by the THREAD_STACK_SIZE macro. */ 93 or the size specified by the THREAD_STACK_SIZE macro. */
82 static size_t _pythread_stacksize = 0; 94 static size_t _pythread_stacksize = 0;
95
96 #ifdef SGI_THREADS
97 #error SGI Irix threads are now unsupported, and code will be removed in 3.3.
98 #include "thread_sgi.h"
99 #endif
100
101 #ifdef SOLARIS_THREADS
102 #define PYTHREAD_NAME "solaris"
103 #include "thread_solaris.h"
104 #endif
105
106 #ifdef SUN_LWP
107 #error SunOS lightweight processes are now unsupported, and code will be removed in 3.3.
108 #include "thread_lwp.h"
109 #endif
110
111 #ifdef HAVE_PTH
112 #error GNU pth threads are now unsupported, and code will be removed in 3.3.
113 #include "thread_pth.h"
114 #undef _POSIX_THREADS
115 #endif
83 116
84 #ifdef _POSIX_THREADS 117 #ifdef _POSIX_THREADS
85 #define PYTHREAD_NAME "pthread" 118 #define PYTHREAD_NAME "pthread"
86 #include "thread_pthread.h" 119 #include "thread_pthread.h"
87 #endif 120 #endif
88 121
122 #ifdef C_THREADS
123 #error Mach C Threads are now unsupported, and code will be removed in 3.3.
124 #include "thread_cthread.h"
125 #endif
126
89 #ifdef NT_THREADS 127 #ifdef NT_THREADS
90 #define PYTHREAD_NAME "nt" 128 #define PYTHREAD_NAME "nt"
91 #include "thread_nt.h" 129 #include "thread_nt.h"
92 #endif 130 #endif
93 131
94 #ifdef OS2_THREADS 132 #ifdef OS2_THREADS
95 #define PYTHREAD_NAME "os2" 133 #define PYTHREAD_NAME "os2"
96 #include "thread_os2.h" 134 #include "thread_os2.h"
135 #endif
136
137 #ifdef PLAN9_THREADS
138 #define PYTHREAD_NAME "plan9"
139 #include "thread_plan9.h"
97 #endif 140 #endif
98 141
99 /* 142 /*
100 #ifdef FOOBAR_THREADS 143 #ifdef FOOBAR_THREADS
101 #include "thread_foobar.h" 144 #include "thread_foobar.h"
102 #endif 145 #endif
103 */ 146 */
104 147
105 /* return the current thread stack size */ 148 /* return the current thread stack size */
106 size_t 149 size_t
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 487 }
445 if (value == NULL) 488 if (value == NULL)
446 #endif 489 #endif
447 { 490 {
448 Py_INCREF(Py_None); 491 Py_INCREF(Py_None);
449 value = Py_None; 492 value = Py_None;
450 } 493 }
451 PyStructSequence_SET_ITEM(threadinfo, pos++, value); 494 PyStructSequence_SET_ITEM(threadinfo, pos++, value);
452 return threadinfo; 495 return threadinfo;
453 } 496 }
OLDNEW
« no previous file with comments | « Python/symtable.c ('k') | Python/thread_cthread.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+