Changeset c6adf17 for select.c


Ignore:
Timestamp:
Oct 1, 2010, 9:22:20 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
afaef6e
Parents:
385cce2
git-author:
David Benjamin <davidben@mit.edu> (09/25/10 02:02:45)
git-committer:
David Benjamin <davidben@mit.edu> (10/01/10 21:22:20)
Message:
Track names along with timers, add :show timers

This will help people with BarnOwls eating CPU to diagnose timer leaks.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • select.c

    r3ecd78b rc6adf17  
    1313}
    1414
    15 owl_timer *owl_select_add_timer(int after, int interval, void (*cb)(owl_timer *, void *), void (*destroy)(owl_timer*), void *data)
     15owl_timer *owl_select_add_timer(const char* name, int after, int interval, void (*cb)(owl_timer *, void *), void (*destroy)(owl_timer*), void *data)
    1616{
    1717  owl_timer *t = owl_malloc(sizeof(owl_timer));
     
    2323  t->destroy = destroy;
    2424  t->data = data;
     25  t->name = name ? owl_strdup(name) : NULL;
    2526
    2627  *timers = g_list_insert_sorted(*timers, t,
     
    3738      t->destroy(t);
    3839    }
     40    owl_free(t->name);
    3941    owl_free(t);
    4042  }
Note: See TracChangeset for help on using the changeset viewer.