Changeset 7d31f7c in mainline
- Timestamp:
- 2010-03-02T23:00:06Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5cbff4
- Parents:
- 91001e2 (diff), 92307f1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/srv/net
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/socket/socket_client.c
r91001e2 r7d31f7c 560 560 fibril_rwlock_write_unlock( & socket_globals.lock ); 561 561 fibril_condvar_wait( & socket->accept_signal, & socket->accept_lock ); 562 // drop the accept lock to avoid deadlock 563 fibril_mutex_unlock( & socket->accept_lock ); 562 564 fibril_rwlock_write_lock( & socket_globals.lock ); 565 fibril_mutex_lock( & socket->accept_lock ); 563 566 } 564 567 -- socket->blocked; … … 759 762 fibril_rwlock_read_unlock( & socket_globals.lock ); 760 763 fibril_condvar_wait( & socket->receive_signal, & socket->receive_lock ); 764 // drop the receive lock to avoid deadlock 765 fibril_mutex_unlock( & socket->receive_lock ); 761 766 fibril_rwlock_read_lock( & socket_globals.lock ); 767 fibril_mutex_lock( & socket->receive_lock ); 762 768 } 763 769 -- socket->blocked; -
uspace/srv/net/tl/icmp/icmp.c
r91001e2 r7d31f7c 343 343 result = ERROR_CODE; 344 344 345 // drop the reply mutex 346 fibril_mutex_unlock( & reply->mutex ); 345 347 // lock the globals again and clean up 346 348 fibril_rwlock_write_lock( & icmp_globals.lock ); -
uspace/srv/net/tl/udp/udp.c
r91001e2 r7d31f7c 420 420 struct sockaddr * addr; 421 421 size_t addrlen; 422 fibril_rwlock_t lock;423 422 ipc_call_t answer; 424 423 int answer_count; … … 434 433 435 434 socket_cores_initialize( & local_sockets ); 436 fibril_rwlock_initialize( & lock );437 435 438 436 while( keep_on_going ){ … … 449 447 break; 450 448 case NET_SOCKET: 451 fibril_rwlock_write_lock( & lock );452 449 * SOCKET_SET_SOCKET_ID( answer ) = SOCKET_GET_SOCKET_ID( call ); 453 450 res = socket_create( & local_sockets, app_phone, NULL, SOCKET_SET_SOCKET_ID( answer )); 454 fibril_rwlock_write_unlock( & lock );455 451 if( res == EOK ){ 456 452 if( tl_get_ip_packet_dimension( udp_globals.ip_phone, & udp_globals.dimensions, DEVICE_INVALID_ID, & packet_dimension ) == EOK ){ … … 465 461 res = data_receive(( void ** ) & addr, & addrlen ); 466 462 if( res == EOK ){ 467 fibril_rwlock_read_lock( & lock );468 463 fibril_rwlock_write_lock( & udp_globals.lock ); 469 464 res = socket_bind( & local_sockets, & udp_globals.sockets, SOCKET_GET_SOCKET_ID( call ), addr, addrlen, UDP_FREE_PORTS_START, UDP_FREE_PORTS_END, udp_globals.last_used_port ); 470 465 fibril_rwlock_write_unlock( & udp_globals.lock ); 471 fibril_rwlock_read_unlock( & lock );472 466 free( addr ); 473 467 } … … 476 470 res = data_receive(( void ** ) & addr, & addrlen ); 477 471 if( res == EOK ){ 478 fibril_rwlock_read_lock( & lock );479 472 fibril_rwlock_write_lock( & udp_globals.lock ); 480 473 res = udp_sendto_message( & local_sockets, SOCKET_GET_SOCKET_ID( call ), addr, addrlen, SOCKET_GET_DATA_FRAGMENTS( call ), SOCKET_SET_DATA_FRAGMENT_SIZE( answer ), SOCKET_GET_FLAGS( call )); … … 484 477 answer_count = 2; 485 478 } 486 fibril_rwlock_read_unlock( & lock );487 479 free( addr ); 488 480 } 489 481 break; 490 482 case NET_SOCKET_RECVFROM: 491 fibril_rwlock_read_lock( & lock );492 483 fibril_rwlock_write_lock( & udp_globals.lock ); 493 484 res = udp_recvfrom_message( & local_sockets, SOCKET_GET_SOCKET_ID( call ), SOCKET_GET_FLAGS( call ), & addrlen ); 494 485 fibril_rwlock_write_unlock( & udp_globals.lock ); 495 fibril_rwlock_read_unlock( & lock );496 486 if( res > 0 ){ 497 487 * SOCKET_SET_READ_DATA_LENGTH( answer ) = res; … … 502 492 break; 503 493 case NET_SOCKET_CLOSE: 504 fibril_rwlock_write_lock( & lock );505 494 fibril_rwlock_write_lock( & udp_globals.lock ); 506 495 res = socket_destroy( udp_globals.net_phone, SOCKET_GET_SOCKET_ID( call ), & local_sockets, & udp_globals.sockets, NULL ); 507 496 fibril_rwlock_write_unlock( & udp_globals.lock ); 508 fibril_rwlock_write_unlock( & lock );509 497 break; 510 498 case NET_SOCKET_GETSOCKOPT:
Note:
See TracChangeset
for help on using the changeset viewer.