Changeset 798105ca in mainline
- Timestamp:
- 2012-08-05T12:54:44Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7cd9b02
- Parents:
- d4112ba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/sock.c
rd4112ba r798105ca 779 779 } 780 780 781 /* Grab recv_buffer_lock because of CV wait in tcp_sock_recv_fibril() */ 782 fibril_mutex_lock(&socket->recv_buffer_lock); 783 socket->sock_core = NULL; 784 fibril_mutex_unlock(&socket->recv_buffer_lock); 785 781 786 rc = socket_destroy(NULL, socket_id, &client->sockets, &gsock, 782 787 tcp_free_sock_data); … … 839 844 log_msg(LVL_DEBUG, "tcp_sock_recv_fibril()"); 840 845 846 fibril_mutex_lock(&sock->recv_buffer_lock); 847 841 848 while (true) { 842 849 log_msg(LVL_DEBUG, "call tcp_uc_receive()"); 843 fibril_mutex_lock(&sock->recv_buffer_lock); 844 while (sock->recv_buffer_used != 0) 850 while (sock->recv_buffer_used != 0 && sock->sock_core != NULL) 845 851 fibril_condvar_wait(&sock->recv_buffer_cv, 846 852 &sock->recv_buffer_lock); … … 852 858 sock->recv_error = trc; 853 859 fibril_condvar_broadcast(&sock->recv_buffer_cv); 854 fibril_mutex_unlock(&sock->recv_buffer_lock);855 tcp_sock_notify_data(sock->sock_core);860 if (sock->sock_core != NULL) 861 tcp_sock_notify_data(sock->sock_core); 856 862 break; 857 863 } … … 861 867 sock->recv_buffer_used = data_len; 862 868 fibril_condvar_broadcast(&sock->recv_buffer_cv); 863 fibril_mutex_unlock(&sock->recv_buffer_lock); 864 tcp_sock_notify_data(sock->sock_core); 865 } 869 if (sock->sock_core != NULL) 870 tcp_sock_notify_data(sock->sock_core); 871 } 872 873 fibril_mutex_unlock(&sock->recv_buffer_lock); 866 874 867 875 tcp_uc_delete(sock->conn);
Note:
See TracChangeset
for help on using the changeset viewer.