Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5926cea7
Commit
5926cea7
authored
Nov 30, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partially implemented kernel/user times in GetThreadTimes (based on a
patch by Ryan Cumming).
parent
374a7abd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
7 deletions
+39
-7
thread.c
dlls/kernel/tests/thread.c
+5
-7
thread.c
scheduler/thread.c
+34
-0
No files found.
dlls/kernel/tests/thread.c
View file @
5926cea7
...
...
@@ -481,13 +481,11 @@ VOID test_GetThreadTimes(DWORD version)
"creationTime was invalid"
);
ok
(
exitTime
.
dwLowDateTime
!=
99
||
exitTime
.
dwHighDateTime
!=
99
,
"exitTime was invalid"
);
todo_wine
{
ok
(
kernelTime
.
dwLowDateTime
!=
99
||
kernelTime
.
dwHighDateTime
!=
99
,
"kernelTime was invalid"
);
ok
(
userTime
.
dwLowDateTime
!=
99
||
userTime
.
dwHighDateTime
!=
99
,
"userTime was invalid"
);
}
ok
(
CloseHandle
(
thread
)
!=
0
,
"ClosewHandle failed"
);
ok
(
kernelTime
.
dwLowDateTime
!=
99
||
kernelTime
.
dwHighDateTime
!=
99
,
"kernelTime was invalid"
);
ok
(
userTime
.
dwLowDateTime
!=
99
||
userTime
.
dwHighDateTime
!=
99
,
"userTime was invalid"
);
ok
(
CloseHandle
(
thread
)
!=
0
,
"CloseHandle failed"
);
}
/* Check the processor affinity functions */
...
...
scheduler/thread.c
View file @
5926cea7
...
...
@@ -27,6 +27,9 @@
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
...
...
@@ -709,6 +712,37 @@ BOOL WINAPI GetThreadTimes(
}
SERVER_END_REQ
;
}
if
(
ret
&&
(
kerneltime
||
usertime
))
{
/* We call times(2) for kernel time or user time */
/* We can only (portably) do this for the current thread */
if
(
thread
==
GetCurrentThread
())
{
ULONGLONG
time
;
struct
tms
time_buf
;
long
clocks_per_sec
=
sysconf
(
_SC_CLK_TCK
);
times
(
&
time_buf
);
if
(
kerneltime
)
{
time
=
(
ULONGLONG
)
time_buf
.
tms_stime
*
10000000
/
clocks_per_sec
;
kerneltime
->
dwHighDateTime
=
time
>>
32
;
kerneltime
->
dwLowDateTime
=
(
DWORD
)
time
;
}
if
(
usertime
)
{
time
=
(
ULONGLONG
)
time_buf
.
tms_utime
*
10000000
/
clocks_per_sec
;
usertime
->
dwHighDateTime
=
time
>>
32
;
usertime
->
dwLowDateTime
=
(
DWORD
)
time
;
}
}
else
{
if
(
kerneltime
)
kerneltime
->
dwHighDateTime
=
kerneltime
->
dwLowDateTime
=
0
;
if
(
usertime
)
usertime
->
dwHighDateTime
=
usertime
->
dwLowDateTime
=
0
;
FIXME
(
"Cannot get kerneltime or usertime of other threads
\n
"
);
}
}
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment