Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/rqueue.c

    ra1a101d r69a93df7  
    3939#include <io/log.h>
    4040#include <stdlib.h>
    41 #include <fibril.h>
     41#include <thread.h>
    4242#include "conn.h"
    4343#include "pdu.h"
     
    7474        tcp_sockpair_t rident;
    7575
    76         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_rqueue_bounce_seg()");
     76        log_msg(LVL_DEBUG, "tcp_rqueue_bounce_seg()");
    7777
    7878#ifdef BOUNCE_TRANSCODE
     
    8181
    8282        if (tcp_pdu_encode(sp, seg, &pdu) != EOK) {
    83                 log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped.");
     83                log_msg(LVL_WARN, "Not enough memory. Segment dropped.");
    8484                return;
    8585        }
    8686
    8787        if (tcp_pdu_decode(pdu, &rident, &dseg) != EOK) {
    88                 log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped.");
     88                log_msg(LVL_WARN, "Not enough memory. Segment dropped.");
    8989                return;
    9090        }
     
    112112{
    113113        tcp_rqueue_entry_t *rqe;
    114         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_rqueue_insert_seg()");
     114        log_msg(LVL_DEBUG, "tcp_rqueue_insert_seg()");
    115115
    116116        tcp_segment_dump(seg);
     
    118118        rqe = calloc(1, sizeof(tcp_rqueue_entry_t));
    119119        if (rqe == NULL) {
    120                 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed allocating RQE.");
     120                log_msg(LVL_ERROR, "Failed allocating RQE.");
    121121                return;
    122122        }
     
    128128}
    129129
    130 /** Receive queue handler fibril. */
    131 static int tcp_rqueue_fibril(void *arg)
     130/** Receive queue handler thread. */
     131static void tcp_rqueue_thread(void *arg)
    132132{
    133133        link_t *link;
    134134        tcp_rqueue_entry_t *rqe;
    135135
    136         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_rqueue_fibril()");
     136        log_msg(LVL_DEBUG, "tcp_rqueue_thread()");
    137137
    138138        while (true) {
     
    142142                tcp_as_segment_arrived(&rqe->sp, rqe->seg);
    143143        }
    144 
    145         /* Not reached */
    146         return 0;
    147144}
    148145
    149 /** Start receive queue handler fibril. */
    150 void tcp_rqueue_fibril_start(void)
     146/** Start receive queue handler thread. */
     147void tcp_rqueue_thread_start(void)
    151148{
    152         fid_t fid;
     149        thread_id_t tid;
     150        int rc;
    153151
    154         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_rqueue_fibril_start()");
     152        log_msg(LVL_DEBUG, "tcp_rqueue_thread_start()");
    155153
    156         fid = fibril_create(tcp_rqueue_fibril, NULL);
    157         if (fid == 0) {
    158                 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed creating rqueue fibril.");
     154        rc = thread_create(tcp_rqueue_thread, NULL, "rqueue", &tid);
     155        if (rc != EOK) {
     156                log_msg(LVL_ERROR, "Failed creating rqueue thread.");
    159157                return;
    160158        }
    161 
    162         fibril_add_ready(fid);
    163159}
    164160
Note: See TracChangeset for help on using the changeset viewer.