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:
@@ -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,
|
status_t status = add_select_sync_pool_entry(&socket->select_pool, sync,
|
||||||
ref, event);
|
ref, event);
|
||||||
if (status < B_OK) {
|
|
||||||
benaphore_unlock(&socket->lock);
|
benaphore_unlock(&socket->lock);
|
||||||
|
|
||||||
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
}
|
|
||||||
|
|
||||||
// check if the event is already present
|
// check if the event is already present
|
||||||
// TODO: add support for poll() types
|
// TODO: add support for poll() types
|
||||||
@@ -359,7 +360,6 @@ socket_request_notification(net_socket *socket, uint8 event, uint32 ref,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
benaphore_unlock(&socket->lock);
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,8 +380,6 @@ socket_cancel_notification(net_socket *socket, uint8 event, selectsync *sync)
|
|||||||
status_t
|
status_t
|
||||||
socket_notify(net_socket *socket, uint8 event, int32 value)
|
socket_notify(net_socket *socket, uint8 event, int32 value)
|
||||||
{
|
{
|
||||||
benaphore_lock(&socket->lock);
|
|
||||||
|
|
||||||
bool notify = true;
|
bool notify = true;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
@@ -402,6 +400,8 @@ socket_notify(net_socket *socket, uint8 event, int32 value)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
benaphore_lock(&socket->lock);
|
||||||
|
|
||||||
if (notify && socket->select_pool)
|
if (notify && socket->select_pool)
|
||||||
notify_select_event_pool(socket->select_pool, event);
|
notify_select_event_pool(socket->select_pool, event);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user