Changeset b8e72fd1 in mainline for uspace/srv/net/udp/assoc.c


Ignore:
Timestamp:
2013-05-30T17:13:02Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
98abd40
Parents:
be2bb4f (diff), 94dfb92 (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.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/udp/assoc.c

    rbe2bb4f rb8e72fd1  
    279279
    280280        fibril_mutex_lock(&assoc->lock);
    281         while (list_empty(&assoc->rcv_queue)) {
     281        while (list_empty(&assoc->rcv_queue) && !assoc->reset) {
    282282                log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - waiting");
    283283                fibril_condvar_wait(&assoc->rcv_queue_cv, &assoc->lock);
     284        }
     285
     286        if (assoc->reset) {
     287                log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - association was reset");
     288                fibril_mutex_unlock(&assoc->lock);
     289                return ECONNABORTED;
    284290        }
    285291
     
    323329}
    324330
     331/** Reset association.
     332 *
     333 * This causes any pendingreceive operations to return immediately with
     334 * UDP_ERESET.
     335 */
     336void udp_assoc_reset(udp_assoc_t *assoc)
     337{
     338        fibril_mutex_lock(&assoc->lock);
     339        assoc->reset = true;
     340        fibril_condvar_broadcast(&assoc->rcv_queue_cv);
     341        fibril_mutex_unlock(&assoc->lock);
     342}
     343
    325344static int udp_assoc_queue_msg(udp_assoc_t *assoc, udp_sockpair_t *sp,
    326345    udp_msg_t *msg)
Note: See TracChangeset for help on using the changeset viewer.