Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a1dc7fe in mainline


Ignore:
Timestamp:
2010-12-26T17:43:23Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
8cd21d16
Parents:
d1c041a
Message:

Global list of open sessions will be useful for debugging.

Location:
uspace/lib/c
Files:
2 edited

Legend:

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

    rd1c041a ra1dc7fe  
    114114
    115115/**
    116  * Mutex protecting the inactive_conn_head list and the session_hash hash table.
     116 * Mutex protecting the inactive_conn_head list and the session list.
    117117 */
    118118static fibril_mutex_t async_sess_mutex;
     
    124124
    125125/**
    126  * List of all existing sessions.
    127  */
    128 //static LIST_INITIALIZE(session_list);
     126 * List of all open sessions.
     127 */
     128static LIST_INITIALIZE(session_list_head);
    129129
    130130/** Initialize the async_sess subsystem.
     
    136136        fibril_mutex_initialize(&async_sess_mutex);
    137137        list_initialize(&inactive_conn_head);
     138        list_initialize(&session_list_head);
    138139}
    139140
     
    142143        sess->sess_phone = phone;
    143144        list_initialize(&sess->conn_head);
     145       
     146        /* Add to list of sessions. */
     147        fibril_mutex_lock(&async_sess_mutex);
     148        list_append(&sess->sess_link, &session_list_head);
     149        fibril_mutex_unlock(&async_sess_mutex);
    144150}
    145151
     
    147153{
    148154        conn_node_t *conn;
     155
     156        /* Remove from list of sessions. */
     157        fibril_mutex_lock(&async_sess_mutex);
     158        list_remove(&sess->sess_link);
     159        fibril_mutex_unlock(&async_sess_mutex);
    149160
    150161        /* We did not connect the phone so we do not hang it up either. */
  • uspace/lib/c/include/async_sess.h

    rd1c041a ra1dc7fe  
    4141        int sess_phone;         /**< Phone for cloning off the connections. */
    4242        link_t conn_head;       /**< List of open data connections. */
     43        link_t sess_link;       /**< Link in global list of open sessions. */
    4344} async_sess_t;
    4445
Note: See TracChangeset for help on using the changeset viewer.