Changeset bed78cb in mainline for uspace/srv/net/tcp/ncsim.c


Ignore:
Timestamp:
2012-05-10T07:28:31Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
81a7858
Parents:
5b26747 (diff), fce7b43 (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 with mainline

File:
1 edited

Legend:

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

    r5b26747 rbed78cb  
    4444#include <io/log.h>
    4545#include <stdlib.h>
    46 #include <thread.h>
     46#include <fibril.h>
    4747#include "conn.h"
    4848#include "ncsim.h"
     
    119119}
    120120
    121 /** Network condition simulator handler thread. */
    122 static void tcp_ncsim_thread(void *arg)
     121/** Network condition simulator handler fibril. */
     122static int tcp_ncsim_fibril(void *arg)
    123123{
    124124        link_t *link;
     
    126126        int rc;
    127127
    128         log_msg(LVL_DEBUG, "tcp_ncsim_thread()");
     128        log_msg(LVL_DEBUG, "tcp_ncsim_fibril()");
    129129
    130130
     
    151151                free(sqe);
    152152        }
     153
     154        /* Not reached */
     155        return 0;
    153156}
    154157
    155 /** Start simulator handler thread. */
    156 void tcp_ncsim_thread_start(void)
     158/** Start simulator handler fibril. */
     159void tcp_ncsim_fibril_start(void)
    157160{
    158         thread_id_t tid;
    159         int rc;
     161        fid_t fid;
    160162
    161         log_msg(LVL_DEBUG, "tcp_ncsim_thread_start()");
     163        log_msg(LVL_DEBUG, "tcp_ncsim_fibril_start()");
    162164
    163         rc = thread_create(tcp_ncsim_thread, NULL, "ncsim", &tid);
    164         if (rc != EOK) {
    165                 log_msg(LVL_ERROR, "Failed creating ncsim thread.");
     165        fid = fibril_create(tcp_ncsim_fibril, NULL);
     166        if (fid == 0) {
     167                log_msg(LVL_ERROR, "Failed creating ncsim fibril.");
    166168                return;
    167169        }
     170
     171        fibril_add_ready(fid);
    168172}
    169173
Note: See TracChangeset for help on using the changeset viewer.