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
24f4eced
Commit
24f4eced
authored
Nov 25, 2002
by
Ryan Cumming
Committed by
Alexandre Julliard
Nov 25, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partially implement GetThreadTimes.
parent
8ed35fe8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
20 deletions
+50
-20
server_protocol.h
include/wine/server_protocol.h
+3
-1
thread.c
scheduler/thread.c
+22
-6
protocol.def
server/protocol.def
+9
-7
thread.c
server/thread.c
+11
-5
thread.h
server/thread.h
+2
-0
trace.c
server/trace.c
+3
-1
No files found.
include/wine/server_protocol.h
View file @
24f4eced
...
@@ -394,6 +394,8 @@ struct get_thread_info_reply
...
@@ -394,6 +394,8 @@ struct get_thread_info_reply
void
*
teb
;
void
*
teb
;
int
exit_code
;
int
exit_code
;
int
priority
;
int
priority
;
time_t
creation_time
;
time_t
exit_time
;
};
};
...
@@ -3460,6 +3462,6 @@ union generic_reply
...
@@ -3460,6 +3462,6 @@ union generic_reply
struct
get_next_hook_reply
get_next_hook_reply
;
struct
get_next_hook_reply
get_next_hook_reply
;
};
};
#define SERVER_PROTOCOL_VERSION 9
0
#define SERVER_PROTOCOL_VERSION 9
1
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
scheduler/thread.c
View file @
24f4eced
...
@@ -677,9 +677,6 @@ DWORD WINAPI QueueUserAPC( PAPCFUNC func, HANDLE hthread, ULONG_PTR data )
...
@@ -677,9 +677,6 @@ DWORD WINAPI QueueUserAPC( PAPCFUNC func, HANDLE hthread, ULONG_PTR data )
/**********************************************************************
/**********************************************************************
* GetThreadTimes [KERNEL32.@] Obtains timing information.
* GetThreadTimes [KERNEL32.@] Obtains timing information.
*
*
* NOTES
* What are the fields where these values are stored?
*
* RETURNS
* RETURNS
* Success: TRUE
* Success: TRUE
* Failure: FALSE
* Failure: FALSE
...
@@ -691,9 +688,28 @@ BOOL WINAPI GetThreadTimes(
...
@@ -691,9 +688,28 @@ BOOL WINAPI GetThreadTimes(
LPFILETIME
kerneltime
,
/* [out] Time thread spent in kernel mode */
LPFILETIME
kerneltime
,
/* [out] Time thread spent in kernel mode */
LPFILETIME
usertime
)
/* [out] Time thread spent in user mode */
LPFILETIME
usertime
)
/* [out] Time thread spent in user mode */
{
{
FIXME
(
"(0x%p): stub
\n
"
,
thread
);
BOOL
ret
=
TRUE
;
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
if
(
creationtime
||
exittime
)
{
/* We need to do a server call to get the creation time or exit time */
/* This works on any thread */
SERVER_START_REQ
(
get_thread_info
)
{
req
->
handle
=
thread
;
req
->
tid_in
=
0
;
if
((
ret
=
!
wine_server_call_err
(
req
)))
{
if
(
creationtime
)
RtlSecondsSince1970ToTime
(
reply
->
creation_time
,
(
LARGE_INTEGER
*
)
creationtime
);
if
(
exittime
)
RtlSecondsSince1970ToTime
(
reply
->
exit_time
,
(
LARGE_INTEGER
*
)
exittime
);
}
}
SERVER_END_REQ
;
}
return
ret
;
}
}
...
...
server/protocol.def
View file @
24f4eced
...
@@ -336,13 +336,15 @@ typedef struct
...
@@ -336,13 +336,15 @@ typedef struct
/* Retrieve information about a thread */
/* Retrieve information about a thread */
@REQ(get_thread_info)
@REQ(get_thread_info)
obj_handle_t handle; /* thread handle */
obj_handle_t handle; /* thread handle */
thread_id_t tid_in; /* thread id (optional) */
thread_id_t tid_in; /* thread id (optional) */
@REPLY
@REPLY
thread_id_t tid; /* server thread id */
thread_id_t tid; /* server thread id */
void* teb; /* thread teb pointer */
void* teb; /* thread teb pointer */
int exit_code; /* thread exit code */
int exit_code; /* thread exit code */
int priority; /* thread priority level */
int priority; /* thread priority level */
time_t creation_time; /* thread creation time */
time_t exit_time; /* thread exit time */
@END
@END
...
...
server/thread.c
View file @
24f4eced
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
#include <string.h>
#include <string.h>
#include <sys/types.h>
#include <sys/types.h>
#include <unistd.h>
#include <unistd.h>
#include <
stdarg
.h>
#include <
time
.h>
#include "winbase.h"
#include "winbase.h"
...
@@ -132,6 +132,8 @@ inline static void init_thread_structure( struct thread *thread )
...
@@ -132,6 +132,8 @@ inline static void init_thread_structure( struct thread *thread )
thread
->
priority
=
THREAD_PRIORITY_NORMAL
;
thread
->
priority
=
THREAD_PRIORITY_NORMAL
;
thread
->
affinity
=
1
;
thread
->
affinity
=
1
;
thread
->
suspend
=
0
;
thread
->
suspend
=
0
;
thread
->
creation_time
=
time
(
NULL
);
thread
->
exit_time
=
0
;
for
(
i
=
0
;
i
<
MAX_INFLIGHT_FDS
;
i
++
)
for
(
i
=
0
;
i
<
MAX_INFLIGHT_FDS
;
i
++
)
thread
->
inflight
[
i
].
server
=
thread
->
inflight
[
i
].
client
=
-
1
;
thread
->
inflight
[
i
].
server
=
thread
->
inflight
[
i
].
client
=
-
1
;
...
@@ -706,6 +708,7 @@ void kill_thread( struct thread *thread, int violent_death )
...
@@ -706,6 +708,7 @@ void kill_thread( struct thread *thread, int violent_death )
{
{
if
(
thread
->
state
==
TERMINATED
)
return
;
/* already killed */
if
(
thread
->
state
==
TERMINATED
)
return
;
/* already killed */
thread
->
state
=
TERMINATED
;
thread
->
state
=
TERMINATED
;
thread
->
exit_time
=
time
(
NULL
);
if
(
current
==
thread
)
current
=
NULL
;
if
(
current
==
thread
)
current
=
NULL
;
if
(
debug_level
)
if
(
debug_level
)
fprintf
(
stderr
,
"%08x: *killed* exit_code=%d
\n
"
,
fprintf
(
stderr
,
"%08x: *killed* exit_code=%d
\n
"
,
...
@@ -878,10 +881,13 @@ DECL_HANDLER(get_thread_info)
...
@@ -878,10 +881,13 @@ DECL_HANDLER(get_thread_info)
if
(
thread
)
if
(
thread
)
{
{
reply
->
tid
=
get_thread_id
(
thread
);
reply
->
tid
=
get_thread_id
(
thread
);
reply
->
teb
=
thread
->
teb
;
reply
->
teb
=
thread
->
teb
;
reply
->
exit_code
=
(
thread
->
state
==
TERMINATED
)
?
thread
->
exit_code
:
STILL_ACTIVE
;
reply
->
exit_code
=
(
thread
->
state
==
TERMINATED
)
?
thread
->
exit_code
:
STILL_ACTIVE
;
reply
->
priority
=
thread
->
priority
;
reply
->
priority
=
thread
->
priority
;
reply
->
creation_time
=
thread
->
creation_time
;
reply
->
exit_time
=
thread
->
exit_time
;
release_object
(
thread
);
release_object
(
thread
);
}
}
}
}
...
...
server/thread.h
View file @
24f4eced
...
@@ -92,6 +92,8 @@ struct thread
...
@@ -92,6 +92,8 @@ struct thread
int
priority
;
/* priority level */
int
priority
;
/* priority level */
int
affinity
;
/* affinity mask */
int
affinity
;
/* affinity mask */
int
suspend
;
/* suspend count */
int
suspend
;
/* suspend count */
time_t
creation_time
;
/* Thread creation time */
time_t
exit_time
;
/* Thread exit time */
};
};
struct
thread_snapshot
struct
thread_snapshot
...
...
server/trace.c
View file @
24f4eced
...
@@ -515,7 +515,9 @@ static void dump_get_thread_info_reply( const struct get_thread_info_reply *req
...
@@ -515,7 +515,9 @@ static void dump_get_thread_info_reply( const struct get_thread_info_reply *req
fprintf
(
stderr
,
" tid=%08x,"
,
req
->
tid
);
fprintf
(
stderr
,
" tid=%08x,"
,
req
->
tid
);
fprintf
(
stderr
,
" teb=%p,"
,
req
->
teb
);
fprintf
(
stderr
,
" teb=%p,"
,
req
->
teb
);
fprintf
(
stderr
,
" exit_code=%d,"
,
req
->
exit_code
);
fprintf
(
stderr
,
" exit_code=%d,"
,
req
->
exit_code
);
fprintf
(
stderr
,
" priority=%d"
,
req
->
priority
);
fprintf
(
stderr
,
" priority=%d,"
,
req
->
priority
);
fprintf
(
stderr
,
" creation_time=%ld,"
,
req
->
creation_time
);
fprintf
(
stderr
,
" exit_time=%ld"
,
req
->
exit_time
);
}
}
static
void
dump_set_thread_info_request
(
const
struct
set_thread_info_request
*
req
)
static
void
dump_set_thread_info_request
(
const
struct
set_thread_info_request
*
req
)
...
...
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