summaryrefslogtreecommitdiff
path: root/mysys/my_context.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-09 08:33:08 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-09 08:33:08 +0200
commit06b7fce9f24116080168b924d17f71b979fc3a14 (patch)
tree5ff9f5684bb118abbee5a9fd3b838d0841661287 /mysys/my_context.c
parent1f2ff25eba6c089b2698cd0dab96155ccbf2afd2 (diff)
parent8494039757a2f6353cc161e7824aab4fe2312d2a (diff)
downloadmariadb-git-06b7fce9f24116080168b924d17f71b979fc3a14.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'mysys/my_context.c')
-rw-r--r--mysys/my_context.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/mysys/my_context.c b/mysys/my_context.c
index fd9415afc94..1368739ac35 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;
}