Don't hold the socket's lock when calling socket_read_avail() or socket_send_avail().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19423 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6cf91f9542
commit
f4b9215615
@ -331,10 +331,11 @@ socket_request_notification(net_socket *socket, uint8 event, uint32 ref,
|
||||
|
||||
status_t status = add_select_sync_pool_entry(&socket->select_pool, sync,
|
||||
ref, event);
|
||||
if (status < B_OK) {
|
||||
benaphore_unlock(&socket->lock);
|
||||
|
||||
benaphore_unlock(&socket->lock);
|
||||
|
||||
if (status < B_OK)
|
||||
return status;
|
||||
}
|
||||
|
||||
// check if the event is already present
|
||||
// TODO: add support for poll() types
|
||||
@ -359,7 +360,6 @@ socket_request_notification(net_socket *socket, uint8 event, uint32 ref,
|
||||
break;
|
||||
}
|
||||
|
||||
benaphore_unlock(&socket->lock);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -380,8 +380,6 @@ socket_cancel_notification(net_socket *socket, uint8 event, selectsync *sync)
|
||||
status_t
|
||||
socket_notify(net_socket *socket, uint8 event, int32 value)
|
||||
{
|
||||
benaphore_lock(&socket->lock);
|
||||
|
||||
bool notify = true;
|
||||
|
||||
switch (event) {
|
||||
@ -402,6 +400,8 @@ socket_notify(net_socket *socket, uint8 event, int32 value)
|
||||
break;
|
||||
}
|
||||
|
||||
benaphore_lock(&socket->lock);
|
||||
|
||||
if (notify && socket->select_pool)
|
||||
notify_select_event_pool(socket->select_pool, event);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user