Piotr Caban : msvcrt: Add ThreadScheduler::Id implementation.
Alexandre Julliard
julliard at winehq.org
Tue Mar 28 15:38:41 CDT 2017
Module: wine
Branch: master
Commit: 118271c5f20917f1943023eaf76801f72646de36
URL: http://source.winehq.org/git/wine.git/?a=commit;h=118271c5f20917f1943023eaf76801f72646de36
Author: Piotr Caban <piotr at codeweavers.com>
Date: Tue Mar 28 10:50:38 2017 +0200
msvcrt: Add ThreadScheduler::Id implementation.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcrt/scheduler.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/scheduler.c b/dlls/msvcrt/scheduler.c
index 1c9a770..18e5636 100644
--- a/dlls/msvcrt/scheduler.c
+++ b/dlls/msvcrt/scheduler.c
@@ -34,6 +34,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
static int context_id = -1;
+static int scheduler_id = -1;
#ifdef __i386__
@@ -109,6 +110,7 @@ typedef struct {
typedef struct {
Scheduler scheduler;
+ unsigned int id;
SchedulerPolicy policy;
} ThreadScheduler;
extern const vtable_ptr MSVCRT_ThreadScheduler_vtable;
@@ -519,8 +521,8 @@ void __thiscall SchedulerPolicy_dtor(SchedulerPolicy *this)
DEFINE_THISCALL_WRAPPER(ThreadScheduler_Id, 4)
unsigned int __thiscall ThreadScheduler_Id(const ThreadScheduler *this)
{
- FIXME("(%p) stub\n", this);
- return 0;
+ TRACE("(%p)\n", this);
+ return this->id;
}
DEFINE_THISCALL_WRAPPER(ThreadScheduler_GetNumberOfVirtualProcessors, 4)
@@ -632,6 +634,7 @@ static ThreadScheduler* ThreadScheduler_ctor(ThreadScheduler *this,
TRACE("(%p)->()\n", this);
this->scheduler.vtable = &MSVCRT_ThreadScheduler_vtable;
+ this->id = InterlockedIncrement(&scheduler_id);
SchedulerPolicy_copy_ctor(&this->policy, policy);
return this;
}
More information about the wine-cvs
mailing list