Commit 5741991b authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Add CurrentScheduler::Detach implementation.

parent 5f72ec06
...@@ -802,7 +802,30 @@ void __cdecl CurrentScheduler_Create(const SchedulerPolicy *policy) ...@@ -802,7 +802,30 @@ void __cdecl CurrentScheduler_Create(const SchedulerPolicy *policy)
/* ?Detach@CurrentScheduler@Concurrency@@SAXXZ */ /* ?Detach@CurrentScheduler@Concurrency@@SAXXZ */
void __cdecl CurrentScheduler_Detach(void) void __cdecl CurrentScheduler_Detach(void)
{ {
FIXME("() stub\n"); ExternalContextBase *context = (ExternalContextBase*)try_get_current_context();
TRACE("()\n");
if(!context)
throw_exception(EXCEPTION_IMPROPER_SCHEDULER_DETACH, 0, NULL);
if(context->context.vtable != &MSVCRT_ExternalContextBase_vtable) {
ERR("unknown context set\n");
return;
}
if(!context->scheduler.next)
throw_exception(EXCEPTION_IMPROPER_SCHEDULER_DETACH, 0, NULL);
call_Scheduler_Release(context->scheduler.scheduler);
if(!context->scheduler.next) {
context->scheduler.scheduler = NULL;
}else {
struct scheduler_list *entry = context->scheduler.next;
context->scheduler.scheduler = entry->scheduler;
context->scheduler.next = entry->next;
MSVCRT_operator_delete(entry);
}
} }
static void create_default_scheduler(void) static void create_default_scheduler(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment