mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
msvcr100: Factor out the mapping of a context to a scheduler.
Signed-off-by: Torge Matthies <tmatthies@codeweavers.com>
This commit is contained in:
parent
a115feab9c
commit
e704c44542
1 changed files with 19 additions and 10 deletions
|
@ -697,29 +697,38 @@ static Context* get_current_context(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static Scheduler* get_scheduler_from_context(Context *ctx)
|
||||
{
|
||||
ExternalContextBase *context = (ExternalContextBase*)ctx;
|
||||
|
||||
if (context->context.vtable != &ExternalContextBase_vtable)
|
||||
return NULL;
|
||||
return context->scheduler.scheduler;
|
||||
}
|
||||
|
||||
static Scheduler* try_get_current_scheduler(void)
|
||||
{
|
||||
ExternalContextBase *context = (ExternalContextBase*)try_get_current_context();
|
||||
Context *context = try_get_current_context();
|
||||
Scheduler *ret;
|
||||
|
||||
if (!context)
|
||||
return NULL;
|
||||
|
||||
if (context->context.vtable != &ExternalContextBase_vtable) {
|
||||
ret = get_scheduler_from_context(context);
|
||||
if (!ret)
|
||||
ERR("unknown context set\n");
|
||||
return NULL;
|
||||
}
|
||||
return context->scheduler.scheduler;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Scheduler* get_current_scheduler(void)
|
||||
{
|
||||
ExternalContextBase *context = (ExternalContextBase*)get_current_context();
|
||||
Context *context = get_current_context();
|
||||
Scheduler *ret;
|
||||
|
||||
if (context->context.vtable != &ExternalContextBase_vtable) {
|
||||
ret = get_scheduler_from_context(context);
|
||||
if (!ret)
|
||||
ERR("unknown context set\n");
|
||||
return NULL;
|
||||
}
|
||||
return context->scheduler.scheduler;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ?CurrentContext@Context@Concurrency@@SAPAV12@XZ */
|
||||
|
|
Loading…
Reference in a new issue