diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-08-10 19:19:05 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-08-10 19:19:05 +0200 |
commit | 309c08c17c56d35e5635a5874fb70719935e5f54 (patch) | |
tree | db63b0f496364456789f390eb5f693dabf0f94a1 /mysys | |
parent | c6fdb92ca829fed893d9e7324e80b1450de16087 (diff) | |
parent | 5ad02062d928cccbd29c0a2db6f0f7ceb33195d1 (diff) | |
download | mariadb-git-309c08c17c56d35e5635a5874fb70719935e5f54.tar.gz |
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_context.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/mysys/my_context.c b/mysys/my_context.c index e4ca4143baf..017cebdc110 100644 --- a/mysys/my_context.c +++ b/mysys/my_context.c @@ -696,30 +696,27 @@ my_context_destroy(struct my_context *c) int my_context_spawn(struct my_context *c, void (*f)(void *), void *d) { - void *current_fiber; c->user_func= f; c->user_arg= d; + return my_context_continue(c); +} + +int +my_context_continue(struct my_context *c) +{ /* This seems to be a common trick to run ConvertThreadToFiber() only on the first occurence in a thread, in a way that works on multiple Windows versions. */ - current_fiber= GetCurrentFiber(); + void *current_fiber= GetCurrentFiber(); if (current_fiber == NULL || current_fiber == (void *)0x1e00) current_fiber= ConvertThreadToFiber(c); c->app_fiber= current_fiber; DBUG_SWAP_CODE_STATE(&c->dbug_state); SwitchToFiber(c->lib_fiber); DBUG_SWAP_CODE_STATE(&c->dbug_state); - return c->return_value; -} -int -my_context_continue(struct my_context *c) -{ - DBUG_SWAP_CODE_STATE(&c->dbug_state); - SwitchToFiber(c->lib_fiber); - DBUG_SWAP_CODE_STATE(&c->dbug_state); return c->return_value; } |