Navigation


Changeset 693:16c373df0947 in freeDiameter


Ignore:
Timestamp:
Jan 21, 2011, 3:12:54 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Cleanups

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/core.c

    r691 r693  
    6969static void * core_runner_thread(void * arg)
    7070{
    71         fd_log_threadname("Core Runner");
    72        
    7371        if (arg && (*(int *)arg == CORE_MODE_IMMEDIATE))
    7472                goto end;
     73       
     74        fd_log_threadname("fD Core Runner");
    7575       
    7676        /* Handle events incoming on the main event queue */
     
    131131end:
    132132        TRACE_DEBUG(INFO, FD_PROJECT_BINARY " framework is stopping...");
     133        fd_log_threadname("fD Core Shutdown");
    133134       
    134135        /* cleanups */
  • libfdproto/init.c

    r687 r693  
    3939pthread_mutex_t fd_cpu_mtx_dummy = PTHREAD_MUTEX_INITIALIZER;
    4040
     41/* function to free the threadnames */
     42static void freelogstr(void * str) {
     43        if (TRACE_BOOL(ANNOYING)) {
     44                if (str) {
     45                        fd_log_debug("(Thread '%s' terminating)\n", (char *)str);
     46                }
     47        }
     48        free(str);
     49}
     50
    4151/* Initialize library variables and threads */
    4252int fd_libproto_init()
     
    4555       
    4656        /* Create the thread key that contains thread name for debug messages */
    47         ret = pthread_key_create(&fd_log_thname, free);
     57        ret = pthread_key_create(&fd_log_thname, freelogstr);
    4858        if (ret != 0) {
    4959                fprintf(stderr, "Error initializing the libfreeDiameter library: %s\n", strerror(ret) );
  • tests/tests.h

    r689 r693  
    169169}
    170170 
    171 static inline void test_init(int argc, char * argv[])
     171static inline void test_init(int argc, char * argv[], char *fname)
    172172{
    173173        memset(fd_g_config, 0, sizeof(struct fd_config));
     
    175175        CHECK( 0, fd_libproto_init() );
    176176       
    177         fd_log_threadname(basename(__FILE__));
     177        fd_log_threadname(basename(fname));
    178178       
    179179        /* Initialize gcrypt and gnutls */
     
    199199        return;
    200200}
    201 #define INIT_FD()  test_init(argc, argv);
     201#define INIT_FD()  test_init(argc, argv, __FILE__);
    202202
    203203#endif /* _TESTS_H */
Note: See TracChangeset for help on using the changeset viewer.