Skip to content

Commit b5d9f15

Browse files
author
Anselm Kruis
committed
merge 3.4-slp (Stackless python#104)
2 parents 01d457e + 81b62be commit b5d9f15

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Stackless/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ What's New in Stackless 3.X.X?
99

1010
*Release date: 20XX-XX-XX*
1111

12+
- https://bitbucket.org/stackless-dev/stackless/issues/104
13+
Initialise the global variable slp_initial_tstate early before it is used.
14+
1215
- https://bitbucket.org/stackless-dev/stackless/issues/103
1316
Fix an invalid assertion during interpreter shutdown.
1417

Stackless/module/stacklessmodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ PyThreadState *slp_initial_tstate = NULL;
137137

138138
static void *slp_error_handler = NULL;
139139

140-
int
140+
int
141141
slp_pickle_with_tracing_state()
142142
{
143143
PyObject *flag, *slp_module;
@@ -315,7 +315,7 @@ PyStackless_GetCurrentId(void)
315315
PyThreadState *ts = PyThreadState_GET();
316316
#endif
317317
PyTaskletObject *t = NULL;
318-
/* if there is threadstate, and there is a main tasklet, then the
318+
/* if there is threadstate, and there is a main tasklet, then the
319319
* "current" is the actively running tasklet.
320320
* If there isn't a "main", then the tasklet in "current" is merely a
321321
* runnable one
@@ -1144,7 +1144,7 @@ build_args(char *format, va_list va)
11441144
return PyTuple_New(0);
11451145
if (args == NULL)
11461146
return NULL;
1147-
1147+
11481148
if (!PyTuple_Check(args)) {
11491149
PyObject *a;
11501150
a = PyTuple_New(1);
@@ -1674,6 +1674,9 @@ static int init_stackless_methods(void)
16741674
int
16751675
_PyStackless_InitTypes(void)
16761676
{
1677+
/* record the thread state for thread support */
1678+
slp_initial_tstate = PyThreadState_GET();
1679+
16771680
if (0
16781681
|| init_stackless_methods()
16791682
|| PyType_Ready(&PyTasklet_Type) /* need this early for the main tasklet */
@@ -1710,9 +1713,6 @@ PyInit__stackless(void)
17101713
)
17111714
return NULL;
17121715

1713-
/* record the thread state for thread support */
1714-
slp_initial_tstate = PyThreadState_GET();
1715-
17161716
/* Create the module and add the functions */
17171717
slp_module = PyModule_Create(&stacklessmodule);
17181718
if (slp_module == NULL)

0 commit comments

Comments
 (0)