Navigation


Changeset 454:f1484823cb4a in freeDiameter for include


Ignore:
Timestamp:
Jul 29, 2010, 4:11:12 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Small hack which might spear some concurrency problems and is quite harmless

Location:
include/freeDiameter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/freeDiameter.h

    r447 r454  
    228228        struct {
    229229               
    230                 enum peer_state pir_state;      /* Current state of the peer in the state machine */
     230                enum peer_state pir_state;      /* Current state of the peer in the state machine. fd_cpu_flush_cache() might be useful before reading. */
    231231               
    232232                char *          pir_realm;      /* The received realm in CER/CEA. */
     
    252252        struct fd_list  pi_endpoints;   /* Endpoint(s) of the remote peer (configured, discovered, or advertized). list of struct fd_endpoint. DNS resolved if empty. */
    253253};
     254
    254255
    255256struct peer_hdr {
  • include/freeDiameter/libfreeDiameter.h

    r453 r454  
    569569}
    570570
     571/* Force flushing the cache of a CPU before reading a shared memory area (use only for atomic reads such as int and void*) */
     572extern pthread_mutex_t fd_cpu_mtx_dummy; /* only for the macro bellow, so that we have reasonably fresh pir_state value when needed */
     573#define fd_cpu_flush_cache() {                          \
     574        (void)pthread_mutex_lock(&fd_cpu_mtx_dummy);    \
     575        (void)pthread_mutex_unlock(&fd_cpu_mtx_dummy);  \
     576}
     577
     578
    571579/*************
    572580 Cancelation cleanup handlers for common objects
Note: See TracChangeset for help on using the changeset viewer.