Changeset 8cd21d16 in mainline for uspace/lib/c/generic/async_sess.c


Ignore:
Timestamp:
2010-12-26T17:52:18Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4791e3c
Parents:
a1dc7fe
Message:

Subst conn_link with sess_link and add some docblocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async_sess.c

    ra1dc7fe r8cd21d16  
    107107#include <assert.h>
    108108
     109/** An inactive open connection. */
    109110typedef struct {
    110         link_t conn_link;       /**< Link for the list of connections. */
    111         link_t global_link;     /**< Link for the global list of phones. */
     111        link_t sess_link;       /**< Link for the session list of inactive connections. */
     112        link_t global_link;     /**< Link for the global list of inactive connectinos. */
    112113        int data_phone;         /**< Connected data phone. */
    113114} conn_node_t;
     
    139140}
    140141
     142/** Create a session.
     143 *
     144 * Session is a logical datapath from a client task to a server task.
     145 * One session can accomodate multiple concurrent exchanges. Here
     146 * @a phone is a phone connected to the desired server task.
     147 *
     148 * This function always succeeds.
     149 *
     150 * @param sess  Session structure provided by caller, will be filled in.
     151 * @param phone Phone connected to the desired server task.
     152 */
    141153void async_session_create(async_sess_t *sess, int phone)
    142154{
     
    150162}
    151163
     164/** Destroy a session.
     165 *
     166 * Dismantle session structure @a sess and release any resources (connections)
     167 * held by the session.
     168 *
     169 * @param sess  Session to destroy.
     170 */
    152171void async_session_destroy(async_sess_t *sess)
    153172{
     
    165184        while (!list_empty(&sess->conn_head)) {
    166185                conn = list_get_instance(sess->conn_head.next, conn_node_t,
    167                     conn_link);
    168 
    169                 list_remove(&conn->conn_link);
     186                    sess_link);
     187
     188                list_remove(&conn->sess_link);
    170189                list_remove(&conn->global_link);
    171190               
     
    177196static void conn_node_initialize(conn_node_t *conn)
    178197{
    179         link_initialize(&conn->conn_link);
     198        link_initialize(&conn->sess_link);
    180199        link_initialize(&conn->global_link);
    181200        conn->data_phone = -1;
     
    200219                 */
    201220                conn = list_get_instance(sess->conn_head.next, conn_node_t,
    202                     conn_link);
    203                 list_remove(&conn->conn_link);
     221                    sess_link);
     222                list_remove(&conn->sess_link);
    204223                list_remove(&conn->global_link);
    205224               
     
    224243                            conn_node_t, global_link);
    225244                        list_remove(&conn->global_link);
    226                         list_remove(&conn->conn_link);
     245                        list_remove(&conn->sess_link);
    227246                        data_phone = conn->data_phone;
    228247                        free(conn);
     
    267286        conn_node_initialize(conn);
    268287        conn->data_phone = data_phone;
    269         list_append(&conn->conn_link, &sess->conn_head);
     288        list_append(&conn->sess_link, &sess->conn_head);
    270289        list_append(&conn->global_link, &inactive_conn_head);
    271290        fibril_mutex_unlock(&async_sess_mutex);
Note: See TracChangeset for help on using the changeset viewer.