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
5c81f829
Commit
5c81f829
authored
May 31, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
May 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Store server thread handle in RpcServerProtseq.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8d956b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
rpc_server.c
dlls/rpcrt4/rpc_server.c
+18
-19
rpc_server.h
dlls/rpcrt4/rpc_server.h
+2
-2
No files found.
dlls/rpcrt4/rpc_server.c
View file @
5c81f829
...
...
@@ -669,21 +669,26 @@ static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg)
{
/* cleanup */
cps
->
ops
->
free_wait_array
(
cps
,
objs
);
EnterCriticalSection
(
&
cps
->
cs
);
LIST_FOR_EACH_ENTRY
(
conn
,
&
cps
->
listeners
,
RpcConnection
,
protseq_entry
)
RPCRT4_CloseConnection
(
conn
);
LIST_FOR_EACH_ENTRY
(
conn
,
&
cps
->
connections
,
RpcConnection
,
protseq_entry
)
rpcrt4_conn_close_read
(
conn
);
LeaveCriticalSection
(
&
cps
->
cs
);
if
(
res
==
0
&&
!
std_listen
)
SetEvent
(
cps
->
server_ready_event
);
break
;
}
else
if
(
res
==
0
)
set_ready_event
=
TRUE
;
}
EnterCriticalSection
(
&
cps
->
cs
);
LIST_FOR_EACH_ENTRY
(
conn
,
&
cps
->
listeners
,
RpcConnection
,
protseq_entry
)
RPCRT4_CloseConnection
(
conn
);
LIST_FOR_EACH_ENTRY
(
conn
,
&
cps
->
connections
,
RpcConnection
,
protseq_entry
)
rpcrt4_conn_close_read
(
conn
);
LeaveCriticalSection
(
&
cps
->
cs
);
if
(
res
==
0
&&
!
std_listen
)
SetEvent
(
cps
->
server_ready_event
);
EnterCriticalSection
(
&
listen_cs
);
CloseHandle
(
cps
->
server_thread
);
cps
->
server_thread
=
NULL
;
LeaveCriticalSection
(
&
listen_cs
);
return
0
;
}
...
...
@@ -707,21 +712,15 @@ static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps)
static
RPC_STATUS
RPCRT4_start_listen_protseq
(
RpcServerProtseq
*
ps
,
BOOL
auto_listen
)
{
RPC_STATUS
status
=
RPC_S_OK
;
HANDLE
server_thread
;
EnterCriticalSection
(
&
listen_cs
);
if
(
ps
->
is_listening
)
goto
done
;
if
(
ps
->
server_thread
)
goto
done
;
if
(
!
ps
->
mgr_mutex
)
ps
->
mgr_mutex
=
CreateMutexW
(
NULL
,
FALSE
,
NULL
);
if
(
!
ps
->
server_ready_event
)
ps
->
server_ready_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
server_thread
=
CreateThread
(
NULL
,
0
,
RPCRT4_server_thread
,
ps
,
0
,
NULL
);
if
(
!
server_thread
)
{
ps
->
server_thread
=
CreateThread
(
NULL
,
0
,
RPCRT4_server_thread
,
ps
,
0
,
NULL
);
if
(
!
ps
->
server_thread
)
status
=
RPC_S_OUT_OF_RESOURCES
;
goto
done
;
}
ps
->
is_listening
=
TRUE
;
CloseHandle
(
server_thread
);
done:
LeaveCriticalSection
(
&
listen_cs
);
...
...
dlls/rpcrt4/rpc_server.h
View file @
5c81f829
...
...
@@ -37,8 +37,8 @@ typedef struct _RpcServerProtseq
struct
list
connections
;
/* CS cs */
CRITICAL_SECTION
cs
;
/*
is the server currently listening?
*/
BOOL
is_listening
;
/* CS ::listen_cs */
/*
handle to listening thread
*/
HANDLE
server_thread
;
/* CS ::listen_cs */
/* mutex for ensuring only one thread can change state at a time */
HANDLE
mgr_mutex
;
/* set when server thread has finished opening connections */
...
...
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