Skip to content

Commit

Permalink
merge 3.4-slp (Stackless python#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anselm Kruis committed Nov 28, 2016
2 parents 01d457e + 81b62be commit b5d9f15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Stackless/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ What's New in Stackless 3.X.X?

*Release date: 20XX-XX-XX*

- https://bitbucket.org/stackless-dev/stackless/issues/104
Initialise the global variable slp_initial_tstate early before it is used.

- https://bitbucket.org/stackless-dev/stackless/issues/103
Fix an invalid assertion during interpreter shutdown.

Expand Down
12 changes: 6 additions & 6 deletions Stackless/module/stacklessmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ PyThreadState *slp_initial_tstate = NULL;

static void *slp_error_handler = NULL;

int
int
slp_pickle_with_tracing_state()
{
PyObject *flag, *slp_module;
Expand Down Expand Up @@ -315,7 +315,7 @@ PyStackless_GetCurrentId(void)
PyThreadState *ts = PyThreadState_GET();
#endif
PyTaskletObject *t = NULL;
/* if there is threadstate, and there is a main tasklet, then the
/* if there is threadstate, and there is a main tasklet, then the
* "current" is the actively running tasklet.
* If there isn't a "main", then the tasklet in "current" is merely a
* runnable one
Expand Down Expand Up @@ -1144,7 +1144,7 @@ build_args(char *format, va_list va)
return PyTuple_New(0);
if (args == NULL)
return NULL;

if (!PyTuple_Check(args)) {
PyObject *a;
a = PyTuple_New(1);
Expand Down Expand Up @@ -1674,6 +1674,9 @@ static int init_stackless_methods(void)
int
_PyStackless_InitTypes(void)
{
/* record the thread state for thread support */
slp_initial_tstate = PyThreadState_GET();

if (0
|| init_stackless_methods()
|| PyType_Ready(&PyTasklet_Type) /* need this early for the main tasklet */
Expand Down Expand Up @@ -1710,9 +1713,6 @@ PyInit__stackless(void)
)
return NULL;

/* record the thread state for thread support */
slp_initial_tstate = PyThreadState_GET();

/* Create the module and add the functions */
slp_module = PyModule_Create(&stacklessmodule);
if (slp_module == NULL)
Expand Down

0 comments on commit b5d9f15

Please sign in to comment.