Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
7f95e259
Commit
7f95e259
authored
Feb 22, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/threads.c: print thread timing statistics on thread destruction (Win32 only).
parent
2512846d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
src/misc/threads.c
src/misc/threads.c
+42
-0
No files found.
src/misc/threads.c
View file @
7f95e259
...
...
@@ -705,7 +705,49 @@ void __vlc_thread_join( vlc_object_t *p_this, char * psz_file, int i_line )
i_ret
=
st_thread_join
(
p_this
->
thread_id
,
NULL
);
#elif defined( UNDER_CE ) || defined( WIN32 )
HMODULE
hmodule
;
BOOL
(
WINAPI
*
OurGetThreadTimes
)(
HANDLE
,
FILETIME
*
,
FILETIME
*
,
FILETIME
*
,
FILETIME
*
);
FILETIME
create_ft
,
exit_ft
,
kernel_ft
,
user_ft
;
int64_t
real_time
,
kernel_time
,
user_time
;
WaitForSingleObject
(
p_this
->
thread_id
,
INFINITE
);
#if defined( UNDER_CE )
hmodule
=
GetModuleHandle
(
_T
(
"COREDLL"
)
);
#else
hmodule
=
GetModuleHandle
(
_T
(
"KERNEL32"
)
);
#endif
OurGetThreadTimes
=
(
BOOL
(
WINAPI
*
)(
HANDLE
,
FILETIME
*
,
FILETIME
*
,
FILETIME
*
,
FILETIME
*
))
GetProcAddress
(
hmodule
,
_T
(
"GetThreadTimes"
)
);
if
(
OurGetThreadTimes
&&
OurGetThreadTimes
(
p_this
->
thread_id
,
&
create_ft
,
&
exit_ft
,
&
kernel_ft
,
&
user_ft
)
)
{
real_time
=
((((
int64_t
)
exit_ft
.
dwHighDateTime
)
<<
32
)
|
exit_ft
.
dwLowDateTime
)
-
((((
int64_t
)
create_ft
.
dwHighDateTime
)
<<
32
)
|
create_ft
.
dwLowDateTime
);
real_time
/=
10
;
kernel_time
=
((((
int64_t
)
kernel_ft
.
dwHighDateTime
)
<<
32
)
|
kernel_ft
.
dwLowDateTime
)
/
10
;
user_time
=
((((
int64_t
)
user_ft
.
dwHighDateTime
)
<<
32
)
|
user_ft
.
dwLowDateTime
)
/
10
;
msg_Dbg
(
p_this
,
"thread times: "
"real "
I64Fd
"m%fs, kernel "
I64Fd
"m%fs, user "
I64Fd
"m%fs"
,
real_time
/
60
/
1000000
,
(
double
)((
real_time
%
(
60
*
1000000
))
/
1000000
.
0
),
kernel_time
/
60
/
1000000
,
(
double
)((
kernel_time
%
(
60
*
1000000
))
/
1000000
.
0
),
user_time
/
60
/
1000000
,
(
double
)((
user_time
%
(
60
*
1000000
))
/
1000000
.
0
)
);
}
CloseHandle
(
p_this
->
thread_id
);
#elif defined( HAVE_KERNEL_SCHEDULER_H )
...
...
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