Navigation


Changeset 7:e5af94b04946 in freeDiameter for libfreeDiameter/sessions.c


Ignore:
Timestamp:
Sep 4, 2009, 6:05:25 PM (15 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added dispatch module and tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfreeDiameter/sessions.c

    r6 r7  
    105105static struct {
    106106        struct fd_list  sentinel;       /* sentinel element for this sublist */
    107         pthread_mutex_t lock;           /* the mutex for this sublist */
     107        pthread_mutex_t lock;           /* the mutex for this sublist -- we might probably change it to rwlock for a little optimization */
    108108} sess_hash [ 1 << SESS_HASH_SIZE ] ;
    109109#define H_MASK( __hash ) ((__hash) & (( 1 << SESS_HASH_SIZE ) - 1))
     
    113113/* The following are used to generate sid values that are eternaly unique */
    114114static uint32_t         sid_h;  /* initialized to the current time in fd_sess_init */
    115 static uint32_t         sid_l;  /* incremented each time a session id is created -- could use atomic operation probably */
     115static uint32_t         sid_l;  /* incremented each time a session id is created */
    116116static pthread_mutex_t  sid_lock = PTHREAD_MUTEX_INITIALIZER;
    117117
     
    130130/********************************************************************************************************/
    131131
    132 /* Initialize a session object. It is not linked now. sid must be already alloc'ed. */
     132/* Initialize a session object. It is not linked now. sid must be already malloc'ed. */
    133133static struct session * new_session(char * sid, size_t sidlen)
    134134{
     
    157157}
    158158       
    159 
    160 
    161 
    162159/* The expiry thread */
    163160static void * exp_fct(void * arg)
Note: See TracChangeset for help on using the changeset viewer.