[Asterisk-cvs] asterisk sched.c,1.14.2.1,1.14.2.2
russell at lists.digium.com
russell at lists.digium.com
Fri Apr 15 02:33:03 CDT 2005
- Previous message: [Asterisk-cvs] asterisk/channels chan_iax2.c, 1.188.2.17,
1.188.2.18 chan_skinny.c, 1.54.2.2, 1.54.2.3 chan_zap.c,
1.344.2.14, 1.344.2.15 iax2.h, 1.15, 1.15.2.1
- Next message: [Asterisk-cvs] asterisk/include/asterisk sched.h,1.3,1.3.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv21241
Modified Files:
Tag: v1-0
sched.c
Log Message:
create useful output for time left to expire (bug #4022)
Index: sched.c
===================================================================
RCS file: /usr/cvsroot/asterisk/sched.c,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -d -r1.14.2.1 -r1.14.2.2
--- sched.c 15 Apr 2005 07:15:39 -0000 1.14.2.1
+++ sched.c 15 Apr 2005 07:24:34 -0000 1.14.2.2
@@ -399,3 +399,28 @@
ast_mutex_unlock(&con->lock);
return x;
}
+
+long ast_sched_when(struct sched_context *con,int id)
+{
+ struct sched *s;
+ long secs;
+ struct timeval now;
+ DEBUG(ast_log(LOG_DEBUG, "ast_sched_when()\n"));
+
+ ast_mutex_lock(&con->lock);
+ s=con->schedq;
+ while (s!=NULL) {
+ if (s->id==id) break;
+ s=s->next;
+ }
+ secs=-1;
+ if (s!=NULL) {
+ if (gettimeofday(&now, NULL)) {
+ ast_log(LOG_NOTICE, "gettimeofday() failed!\n");
+ } else {
+ secs=s->when.tv_sec-now.tv_sec;
+ }
+ }
+ ast_mutex_unlock(&con->lock);
+ return secs;
+}
- Previous message: [Asterisk-cvs] asterisk/channels chan_iax2.c, 1.188.2.17,
1.188.2.18 chan_skinny.c, 1.54.2.2, 1.54.2.3 chan_zap.c,
1.344.2.14, 1.344.2.15 iax2.h, 1.15, 1.15.2.1
- Next message: [Asterisk-cvs] asterisk/include/asterisk sched.h,1.3,1.3.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the svn-commits
mailing list