port: make ep_port_delete() thread-safe
This commit is contained in:
parent
7476633975
commit
258bc13100
@ -64,6 +64,8 @@ int ep_port_close(ep_port_t* port_info) {
|
||||
int ep_port_delete(ep_port_t* port_info) {
|
||||
tree_node_t* tree_node;
|
||||
|
||||
EnterCriticalSection(&port_info->lock);
|
||||
|
||||
if (port_info->iocp != NULL)
|
||||
_ep_port_close_iocp(port_info);
|
||||
|
||||
@ -78,6 +80,8 @@ int ep_port_delete(ep_port_t* port_info) {
|
||||
poll_group_allocator_delete(pga);
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&port_info->lock);
|
||||
|
||||
DeleteCriticalSection(&port_info->lock);
|
||||
|
||||
_ep_port_free(port_info);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user