diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-02-19 01:28:55 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-02-19 01:28:55 +0000 |
commit | ccb90a1dea2a33de1b9d4356bb97e8e3d4f4fb47 (patch) | |
tree | 85eb48881785779bbfe3b6e70cd8a044d37af4bd /pjlib/src | |
parent | c4f0ced120a0d777cac4948f83408aa4d6262b28 (diff) |
Added assert in timer if entry is scheduled more than once
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@193 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src')
-rw-r--r-- | pjlib/src/pj/timer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c index 8eaab797..2a791b63 100644 --- a/pjlib/src/pj/timer.c +++ b/pjlib/src/pj/timer.c @@ -446,6 +446,9 @@ PJ_DEF(pj_status_t) pj_timer_heap_schedule( pj_timer_heap_t *ht, PJ_ASSERT_RETURN(ht && entry && delay, PJ_EINVAL); PJ_ASSERT_RETURN(entry->cb != NULL, PJ_EINVAL); + /* Prevent same entry from being scheduled more than once */ + PJ_ASSERT_RETURN(entry->_timer_id < 1, PJ_EINVALIDOP); + pj_gettimeofday(&expires); PJ_TIME_VAL_ADD(expires, *delay); |