您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tmr_cancel函数代码示例

51自学网 2021-06-03 08:52:42
  C++
这篇教程C++ tmr_cancel函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中tmr_cancel函数的典型用法代码示例。如果您正苦于以下问题:C++ tmr_cancel函数的具体用法?C++ tmr_cancel怎么用?C++ tmr_cancel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了tmr_cancel函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: conn_close

static void conn_close(struct sip_conn *conn, int err){	struct le *le;	conn->sc = mem_deref(conn->sc);	conn->tc = mem_deref(conn->tc);	tmr_cancel(&conn->tmr_ka);	tmr_cancel(&conn->tmr);	hash_unlink(&conn->he);	le = list_head(&conn->ql);	while (le) {		struct sip_connqent *qent = le->data;		le = le->next;		if (qent->qentp) {			*qent->qentp = NULL;			qent->qentp = NULL;		}		qent->transph(err, qent->arg);		list_unlink(&qent->le);		mem_deref(qent);	}	sip_keepalive_signal(&conn->kal, err);}
开发者ID:Issic47,项目名称:libre,代码行数:29,


示例2: destructor

static void destructor(void *arg){	struct sipsess_reply *reply = arg;	list_unlink(&reply->le);	tmr_cancel(&reply->tmr);	tmr_cancel(&reply->tmrg);	mem_deref((void *)reply->msg);	mem_deref(reply->mb);}
开发者ID:Issic47,项目名称:libre,代码行数:10,


示例3: allocator_reset

void allocator_reset(struct allocator *allocator){	if (!allocator)		return;	tmr_cancel(&allocator->tmr);	tmr_cancel(&allocator->tmr_ui);	tmr_cancel(&allocator->tmr_pace);	list_flush(&allocator->allocl);}
开发者ID:alfredh,项目名称:turnperf,代码行数:10,


示例4: clear_connection

static voidclear_connection( connecttab* c, struct timeval* tvP )    {    ClientData client_data;    /* If we haven't actually sent the buffered response yet, do so now. */    httpd_write_response( c->hc );    if ( c->idle_read_timer != (Timer*) 0 )	{	tmr_cancel( c->idle_read_timer );	c->idle_read_timer = 0;	}    if ( c->idle_send_timer != (Timer*) 0 )	{	tmr_cancel( c->idle_send_timer );	c->idle_send_timer = 0;	}    if ( c->wakeup_timer != (Timer*) 0 )	{	tmr_cancel( c->wakeup_timer );	c->wakeup_timer = 0;	}    /* This is our version of Apache's lingering_close() routine, which is    ** their version of the often-broken SO_LINGER socket option.  For why    ** this is necessary, see http://www.apache.org/docs/misc/fin_wait_2.html    ** What we do is delay the actual closing for a few seconds, while reading    ** any bytes that come over the connection.  However, we don't want to do    ** this unless it's necessary, because it ties up a connection slot and    ** file descriptor which means our maximum connection-handling rate    ** is lower.  So, elsewhere we set a flag when we detect the few    ** circumstances that make a lingering close necessary.  If the flag    ** isn't set we do the real close now.    */    if ( c->hc->should_linger )	{	c->conn_state = CNST_LINGERING;	fdwatch_del_fd( c->hc->conn_fd );	fdwatch_add_fd( c->hc->conn_fd, c, FDW_READ );	/* Make sure we are still in no-delay mode. */	httpd_set_ndelay( c->hc->conn_fd );	client_data.p = c;	c->linger_timer = tmr_create(	    tvP, linger_clear_connection, client_data, LINGER_TIME * 1000L, 0 );	if ( c->linger_timer == (Timer*) 0 )	    {	    syslog( LOG_CRIT, "tmr_create(linger_clear_connection) failed" );	    exit( 1 );	    }	}    else	really_clear_connection( c, tvP );    }
开发者ID:tisrael,项目名称:thttpd-2.21b,代码行数:54,


示例5: conn_destructor

static void conn_destructor(void *arg){	struct sip_conn *conn = arg;	tmr_cancel(&conn->tmr_ka);	tmr_cancel(&conn->tmr);	list_flush(&conn->kal);	list_flush(&conn->ql);	hash_unlink(&conn->he);	mem_deref(conn->sc);	mem_deref(conn->tc);	mem_deref(conn->mb);}
开发者ID:Issic47,项目名称:libre,代码行数:13,


示例6: clear_connection

static void clear_connection(struct connect_s *conn, struct timeval *tv){  ClientData client_data;  if (conn->wakeup_timer != NULL)    {      tmr_cancel(conn->wakeup_timer);      conn->wakeup_timer = 0;    }  /* This is our version of Apache's lingering_close() routine, which is   * their version of the often-broken SO_LINGER socket option.  For why   * this is necessary, see http://www.apache.org/docs/misc/fin_wait_2.html   * What we do is delay the actual closing for a few seconds, while reading   * any bytes that come over the connection.  However, we don't want to do   * this unless it's necessary, because it ties up a connection slot and   * file descriptor which means our maximum connection-handling rateis   * lower.  So, elsewhere we set a flag when we detect the few   * circumstances that make a lingering close necessary.  If the flag isn't   * set we do the real close now.   */  if (conn->conn_state == CNST_LINGERING)    {      /* If we were already lingering, shut down for real */      tmr_cancel(conn->linger_timer);      conn->linger_timer      = NULL;      conn->hc->should_linger = false;    }  else if (conn->hc->should_linger)    {      fdwatch_del_fd(fw, conn->hc->conn_fd);      conn->conn_state = CNST_LINGERING;      fdwatch_add_fd(fw, conn->hc->conn_fd, conn);      client_data.p = conn;      conn->linger_timer = tmr_create(tv, linger_clear_connection, client_data,                                      CONFIG_THTTPD_LINGER_MSEC, 0);      if (conn->linger_timer != NULL)        {          return;        }      nerr("ERROR: tmr_create(linger_clear_connection) failed/n");    }  /* Either we are done lingering, we shouldn't linger, or we failed to setup the linger */  really_clear_connection(conn);}
开发者ID:hll4fork,项目名称:nuttx-apps,代码行数:51,


示例7: destructor

static void destructor(void *arg){	struct sip_ctrans *ct = arg;	hash_unlink(&ct->he);	tmr_cancel(&ct->tmr);	tmr_cancel(&ct->tmre);	mem_deref(ct->met);	mem_deref(ct->branch);	mem_deref(ct->qent);	mem_deref(ct->req);	mem_deref(ct->mb);	mem_deref(ct->mb_ack);}
开发者ID:ClearwaterCore,项目名称:libre-upstream,代码行数:14,


示例8: stop_tx

static void stop_tx(struct autx *tx, struct audio *a){	if (!tx || !a)		return;	switch (a->cfg.txmode) {#ifdef HAVE_PTHREAD	case AUDIO_MODE_THREAD:	case AUDIO_MODE_THREAD_REALTIME:		if (tx->u.thr.run) {			tx->u.thr.run = false;			pthread_join(tx->u.thr.tid, NULL);		}		break;#endif	case AUDIO_MODE_TMR:		tmr_cancel(&tx->u.tmr);		break;	default:		break;	}	/* audio source must be stopped first */	tx->ausrc = mem_deref(tx->ausrc);	tx->aubuf = mem_deref(tx->aubuf);	list_flush(&tx->filtl);}
开发者ID:quentusrex,项目名称:baresip,代码行数:30,


示例9: destructor

static void destructor(void *arg){	struct vidisp_st *st = arg;	tmr_cancel(&st->tmr);	sdl_reset(st);}
开发者ID:lmangani,项目名称:baresip,代码行数:7,


示例10: module_close

static int module_close(void){    tmr_cancel(&tmr);    list_flush(&mwil);    return 0;}
开发者ID:qwertos,项目名称:baresip,代码行数:7,


示例11: req_connect

static int req_connect(struct http_req *req){	int err = EINVAL;	while (req->srvc > 0) {		--req->srvc;		tmr_cancel(&req->tmr);		req->sc = mem_deref(req->sc);		req->tc = mem_deref(req->tc);		req->mb = mem_deref(req->mb);		err = tcp_connect(&req->tc, &req->srvv[req->srvc],				  estab_handler, recv_handler, close_handler,				  req);		if (err)			continue;#ifdef USE_TLS		if (req->secure) {			err = tls_start_tcp(&req->sc, req->tls, req->tc, 0);			if (err) {				req->tc = mem_deref(req->tc);				continue;			}		}#endif		tmr_start(&req->tmr, CONN_TIMEOUT, timeout_handler, req);		break;	}	return err;}
开发者ID:chk-jxcn,项目名称:libre,代码行数:35,


示例12: destructor

static void destructor(void *arg){	struct sipnot *not = arg;	tmr_cancel(&not->tmr);	if (!not->terminated) {		if (terminate(not, SIPEVENT_DEACTIVATED))			return;	}	hash_unlink(&not->he);	mem_deref(not->req);	mem_deref(not->dlg);	mem_deref(not->auth);	mem_deref(not->mb);	mem_deref(not->event);	mem_deref(not->id);	mem_deref(not->cuser);	mem_deref(not->hdrs);	mem_deref(not->ctype);	mem_deref(not->sock);	mem_deref(not->sip);}
开发者ID:tamy83,项目名称:baresip-android-mtt,代码行数:25,


示例13: sipevent_notify

int sipevent_notify(struct sipnot *not, struct mbuf *mb,		    enum sipevent_subst state, enum sipevent_reason reason,		    uint32_t retry_after){	if (!not || not->terminated)		return EINVAL;	if (mb || state != SIPEVENT_TERMINATED) {		mem_deref(not->mb);		not->mb = mem_ref(mb);	}	switch (state) {	case SIPEVENT_ACTIVE:	case SIPEVENT_PENDING:		not->substate = state;		return sipnot_notify(not);	case SIPEVENT_TERMINATED:		tmr_cancel(&not->tmr);		not->retry_after = retry_after;		(void)terminate(not, reason);		return 0;	default:		return EINVAL;	}}
开发者ID:tamy83,项目名称:baresip-android-mtt,代码行数:29,


示例14: metric_reset

void metric_reset(struct metric *metric){	if (!metric)		return;	tmr_cancel(&metric->tmr);}
开发者ID:Studio-Link,项目名称:baresip_old,代码行数:7,


示例15: tmr_run

void tmr_run(struct timeval *nowP){	int h;	Timer *t;	Timer *next;	for (h = 0; h < HASH_SIZE; ++h)		for (t = timers[h]; t; t = next) {			next = t->next;			/* Since the lists are sorted, as soon as we find a timer			** that isn't ready yet, we can go on to the next list.			*/			if (t->time.tv_sec > nowP->tv_sec || (t->time.tv_sec == nowP->tv_sec &&							      t->time.tv_usec > nowP->tv_usec))				break;			(t->timer_proc) (t->arg, nowP);			if (t->periodic) {				/* Reschedule. */				t->time.tv_sec  +=  t->msecs / 1000L;				t->time.tv_usec += (t->msecs % 1000L) * 1000L;				if (t->time.tv_usec >= 1000000L) {					t->time.tv_sec += t->time.tv_usec / 1000000L;					t->time.tv_usec %= 1000000L;				}				l_resort(t);			} else				tmr_cancel(t);		}}
开发者ID:troglobit,项目名称:merecat,代码行数:30,


示例16: call_destructor

static void call_destructor(void *arg){	struct call *call = arg;	if (call->state != STATE_IDLE)		print_summary(call);	call_stream_stop(call);	list_unlink(&call->le);	tmr_cancel(&call->tmr_dtmf);	mem_deref(call->sess);	mem_deref(call->local_uri);	mem_deref(call->local_name);	mem_deref(call->peer_uri);	mem_deref(call->peer_name);	mem_deref(call->audio);#ifdef USE_VIDEO	mem_deref(call->video);	mem_deref(call->bfcp);#endif	mem_deref(call->sdp);	mem_deref(call->mnats);	mem_deref(call->mencs);	mem_deref(call->sub);	mem_deref(call->not);	mem_deref(call->acc);}
开发者ID:sealaunch,项目名称:baresip,代码行数:28,


示例17: tmr_run

voidtmr_run( struct timeval* nowP )    {    Timer* t;    Timer* next;    for ( t = timers; t != (Timer*) 0; t = next )	{	next = t->next;	if ( t->time.tv_sec < nowP->tv_sec ||	     ( t->time.tv_sec == nowP->tv_sec &&	       t->time.tv_usec < nowP->tv_usec ) )	    {	    (t->timer_proc)( t->client_data, nowP );	    if ( t->periodic )		{		/* Reschedule. */		t->time.tv_sec += t->msecs / 1000L;		t->time.tv_usec += ( t->msecs % 1000L ) * 1000L;		if ( t->time.tv_usec >= 1000000L )		    {		    t->time.tv_sec += t->time.tv_usec / 1000000L;		    t->time.tv_usec %= 1000000L;		    }		}	    else		tmr_cancel( t );	    }	}    }
开发者ID:kragen,项目名称:mod_pubsub,代码行数:30,


示例18: tmr_destroy

voidtmr_destroy( void )    {    while ( timers != (Timer*) 0 )	tmr_cancel( timers );    tmr_cleanup();    }
开发者ID:kragen,项目名称:mod_pubsub,代码行数:7,


示例19: destructor

static void destructor(void *arg){	struct bfcp_ctrans *ct = arg;	list_unlink(&ct->le);	tmr_cancel(&ct->tmr);}
开发者ID:ClearwaterCore,项目名称:libre-upstream,代码行数:7,


示例20: destructor

static void destructor(void *arg){	struct sipreg *reg = arg;	tmr_cancel(&reg->tmr);	if (!reg->terminated) {		reg->resph = dummy_handler;		reg->terminated = true;		if (reg->req) {			mem_ref(reg);			return;		}		if (reg->registered && !request(reg, true)) {			mem_ref(reg);			return;		}	}	mem_deref(reg->ka);	mem_deref(reg->dlg);	mem_deref(reg->auth);	mem_deref(reg->cuser);	mem_deref(reg->sip);	mem_deref(reg->hdrs);	mem_deref(reg->params);}
开发者ID:ClearwaterCore,项目名称:libre-upstream,代码行数:30,


示例21: tmr_run

voidtmr_run(struct timeval *nowP){  int h;  Timer *t;  Timer *next;  for (h = 0; h < HASH_SIZE; ++h)    for (t = timers[h]; t != (Timer *)0; t = next) {      next = t->next;      /* Since the lists are sorted, as soon as we find a timer       ** that isn't ready yet, we can go on to the next list.       */      if (t->time.tv_sec > nowP->tv_sec || (t->time.tv_sec == nowP->tv_sec && t->time.tv_usec > nowP->tv_usec))        break;      /* Invalidate mstimeout cache, since we're modifying the queue */      mstimeout_cache = -1;      (t->timer_proc)(t->client_data, nowP);      if (t->periodic) {        /* Reschedule. */        t->time.tv_sec += t->msecs / 1000L;        t->time.tv_usec += (t->msecs % 1000L) * 1000L;        if (t->time.tv_usec >= 1000000L) {          t->time.tv_sec += t->time.tv_usec / 1000000L;          t->time.tv_usec %= 1000000L;        }        l_resort(t);      } else        tmr_cancel(t);    }}
开发者ID:EmAndrews,项目名称:trafficserver,代码行数:33,


示例22: invite_response

static void invite_response(struct sip_ctrans *ct, const struct sip_msg *msg){	switch (ct->state) {	case CALLING:		tmr_cancel(&ct->tmr);		tmr_cancel(&ct->tmre);		/*@[email
C++ tmr_start函数代码示例
C++ tmr_StopTimer函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。