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

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

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

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

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

示例1: datalink_LayerDown

static voiddatalink_LayerDown(void *v, struct fsm *fp){  /* The given FSM has been told to come down */  struct datalink *dl = (struct datalink *)v;  if (fp->proto == PROTO_LCP) {    switch (dl->state) {      case DATALINK_OPEN:        peerid_Init(&dl->peer);        fsm2initial(&dl->physical->link.ccp.fsm);        datalink_NewState(dl, DATALINK_LCP);  /* before parent TLD */        (*dl->parent->LayerDown)(dl->parent->object, fp);        /* FALLTHROUGH (just in case) */      case DATALINK_CBCP:        if (!dl->cbcp.required)          cbcp_Down(&dl->cbcp);        /* FALLTHROUGH (just in case) */      case DATALINK_AUTH:        timer_Stop(&dl->pap.authtimer);        timer_Stop(&dl->chap.auth.authtimer);    }    datalink_NewState(dl, DATALINK_LCP);    datalink_AuthReInit(dl);  }}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:28,


示例2: i4b_Timeout

/* * i4b_Timeout() watches the DCD signal and mentions it if it's status * changes. */static voidi4b_Timeout(void *data){  struct physical *p = data;  struct i4bdevice *dev = device2i4b(p->handler);  int ombits, change;  timer_Stop(&dev->Timer);  dev->Timer.load = SECTICKS;		/* Once a second please */  timer_Start(&dev->Timer);  ombits = dev->mbits;  if (p->fd >= 0) {    if (ioctl(p->fd, TIOCMGET, &dev->mbits) < 0) {      log_Printf(LogPHASE, "%s: ioctl error (%s)!/n", p->link.name,                 strerror(errno));      datalink_Down(p->dl, CLOSE_NORMAL);      timer_Stop(&dev->Timer);      return;    }  } else    dev->mbits = 0;  if (ombits == -1) {    /* First time looking for carrier */    if (Online(dev))      log_Printf(LogPHASE, "%s: %s: CD detected/n", p->link.name, p->name.full);    else if (++dev->carrier_seconds >= dev->dev.cd.delay) {      log_Printf(LogPHASE, "%s: %s: No carrier"                 " (increase ``set cd'' from %d ?)/n",                 p->link.name, p->name.full, dev->dev.cd.delay);      timer_Stop(&dev->Timer);      /* i4b_AwaitCarrier() will notice */    } else {      /* Keep waiting */      log_Printf(LogDEBUG, "%s: %s: Still no carrier (%d/%d)/n",                 p->link.name, p->name.full, dev->carrier_seconds,                 dev->dev.cd.delay);      dev->mbits = -1;    }  } else {    change = ombits ^ dev->mbits;    if (change & TIOCM_CD) {      if (dev->mbits & TIOCM_CD)        log_Printf(LogDEBUG, "%s: offline -> online/n", p->link.name);      else {        log_Printf(LogDEBUG, "%s: online -> offline/n", p->link.name);        log_Printf(LogPHASE, "%s: Carrier lost/n", p->link.name);        datalink_Down(p->dl, CLOSE_NORMAL);        timer_Stop(&dev->Timer);      }    } else      log_Printf(LogDEBUG, "%s: Still %sline/n", p->link.name,                 Online(dev) ? "on" : "off");  }}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:60,


示例3: throughput_stop

voidthroughput_stop(struct pppThroughput *t){  if (t->Timer.state != TIMER_STOPPED)    time(&t->downtime);  timer_Stop(&t->Timer);}
开发者ID:coyizumi,项目名称:cs111,代码行数:7,


示例4: throughput_sampler

static voidthroughput_sampler(void *v){  struct pppThroughput *t = (struct pppThroughput *)v;  unsigned long long old;  int uptime, divisor;  unsigned long long octets;  timer_Stop(&t->Timer);  uptime = throughput_uptime(t);  divisor = uptime < t->SamplePeriod ? uptime + 1 : t->SamplePeriod;  old = t->in.SampleOctets[t->nSample];  t->in.SampleOctets[t->nSample] = t->OctetsIn;  t->in.OctetsPerSecond = (t->in.SampleOctets[t->nSample] - old) / divisor;  old = t->out.SampleOctets[t->nSample];  t->out.SampleOctets[t->nSample] = t->OctetsOut;  t->out.OctetsPerSecond = (t->out.SampleOctets[t->nSample] - old) / divisor;  octets = t->in.OctetsPerSecond + t->out.OctetsPerSecond;  if (t->BestOctetsPerSecond < octets) {    t->BestOctetsPerSecond = octets;    time(&t->BestOctetsPerSecondTime);  }  if (++t->nSample == t->SamplePeriod)    t->nSample = 0;  if (t->callback.fn != NULL && uptime >= t->SamplePeriod)    (*t->callback.fn)(t->callback.data);  timer_Start(&t->Timer);}
开发者ID:coyizumi,项目名称:cs111,代码行数:35,


示例5: i4b_StopTimer

static voidi4b_StopTimer(struct physical *p){  struct i4bdevice *dev = device2i4b(p->handler);  timer_Stop(&dev->Timer);}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:7,


示例6: datalink_Destroy

struct datalink *datalink_Destroy(struct datalink *dl){  struct datalink *result;  if (dl->state != DATALINK_CLOSED) {    log_Printf(LogERROR, "Oops, destroying a datalink in state %s/n",              datalink_State(dl));    switch (dl->state) {      case DATALINK_HANGUP:      case DATALINK_DIAL:      case DATALINK_LOGIN:        chat_Finish(&dl->chat);		/* Gotta blat the timers ! */        break;    }  }  chat_Destroy(&dl->chat);  timer_Stop(&dl->dial.timer);  result = dl->next;  physical_Destroy(dl->physical);  free(dl->name);  free(dl);  return result;}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:26,


示例7: datalink_OpenTimeout

static voiddatalink_OpenTimeout(void *v){  struct datalink *dl = (struct datalink *)v;  timer_Stop(&dl->dial.timer);  if (dl->state == DATALINK_OPENING)    log_Printf(LogCHAT, "%s: Redial timer expired./n", dl->name);}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:9,


示例8: vUnitMenu_Init

/*    Function: vUnitMenu_Init    Description -    Initialise the menu to be ready for all states and makes it active. Sets the default state to be    the base state.    2 argument:    Unit_Menu *menu - The unit menu to initialise.    Base_State *bs - The main state that the game is played in. Changed to point to the unit menu states.*/void vUnitMenu_Init(Unit_Menu *menu, Base_State *bs){    vUnitMenu_InitBase(menu);    bs->render = vUnitMenuState_Render;    bs->logic = vUnitMenuState_Update;    timer_Stop(&menu->spine.sTimer, 500);    return;}
开发者ID:sigt44,项目名称:ventifact,代码行数:22,


示例9: datalink2iov

intdatalink2iov(struct datalink *dl, struct iovec *iov, int *niov, int maxiov,             int *auxfd, int *nauxfd){  /* If `dl' is NULL, we're allocating before a Fromiov() */  int link_fd;  if (dl) {    timer_Stop(&dl->dial.timer);    /* The following is purely for the sake of paranoia */    cbcp_Down(&dl->cbcp);    timer_Stop(&dl->pap.authtimer);    timer_Stop(&dl->chap.auth.authtimer);  }  if (*niov >= maxiov - 1) {    log_Printf(LogERROR, "Toiov: No room for datalink !/n");    if (dl) {      free(dl->name);      free(dl);    }    return -1;  }  iov[*niov].iov_base = (void *)dl;  iov[(*niov)++].iov_len = sizeof *dl;  iov[*niov].iov_base = dl ? realloc(dl->name, DATALINK_MAXNAME) : NULL;  iov[(*niov)++].iov_len = DATALINK_MAXNAME;  link_fd = physical2iov(dl ? dl->physical : NULL, iov, niov, maxiov, auxfd,                         nauxfd);  if (link_fd == -1 && dl) {    free(dl->name);    free(dl);  }  return link_fd;}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:39,


示例10: control_Stop

/*    Function: control_Stop    Description -    Prevents a control event from activating for a certain time, if stopTime is -1 then    it will pause the event until there is a resume requested.    2 arguments:    Control_Event *c - the event to be stopped.    int stopTime - How long the event should be stopped for, if -1 then forever.*/void control_Stop(Control_Event *c, int stopTime){    if(stopTime < 0)    {        timer_Pause(&c->repeater);    }    else    {        timer_Stop(&c->repeater, stopTime);    }    return;}
开发者ID:sigt44,项目名称:ventifact,代码行数:24,


示例11: auth_StartReq

voidauth_StartReq(struct authinfo *authp){  timer_Stop(&authp->authtimer);  authp->authtimer.func = AuthTimeout;  authp->authtimer.name = "auth";  authp->authtimer.load = authp->cfg.fsm.timeout * SECTICKS;  authp->authtimer.arg = (void *)authp;  authp->retry = authp->cfg.fsm.maxreq;  authp->id = 1;  (*authp->fn.req)(authp);  timer_Start(&authp->authtimer);}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:13,


示例12: StoppedTimeout

static voidStoppedTimeout(void *v){  struct fsm *fp = (struct fsm *)v;  log_Printf(fp->LogLevel, "%s: Stopped timer expired/n", fp->link->name);  if (fp->OpenTimer.state == TIMER_RUNNING) {    log_Printf(LogWARN, "%s: %s: aborting open delay due to stopped timer/n",              fp->link->name, fp->name);    timer_Stop(&fp->OpenTimer);  }  if (fp->state == ST_STOPPED)    fsm2initial(fp);}
开发者ID:kusumi,项目名称:DragonFlyBSD,代码行数:14,


示例13: i4b_StartTimer

static voidi4b_StartTimer(struct physical *p){  struct i4bdevice *dev = device2i4b(p->handler);  timer_Stop(&dev->Timer);  dev->Timer.load = SECTICKS;  dev->Timer.func = i4b_Timeout;  dev->Timer.name = "i4b CD";  dev->Timer.arg = p;  log_Printf(LogDEBUG, "%s: Using i4b_Timeout [%p]/n",             p->link.name, i4b_Timeout);  timer_Start(&dev->Timer);}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:14,


示例14: AuthTimeout

static voidAuthTimeout(void *vauthp){  struct authinfo *authp = (struct authinfo *)vauthp;  timer_Stop(&authp->authtimer);  if (--authp->retry > 0) {    authp->id++;    (*authp->fn.req)(authp);    timer_Start(&authp->authtimer);  } else {    log_Printf(LogPHASE, "Auth: No response from server/n");    datalink_AuthNotOk(authp->physical->dl);  }}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:15,


示例15: i4b_Offline

static voidi4b_Offline(struct physical *p){  struct i4bdevice *dev = device2i4b(p->handler);  if (p->fd >= 0) {    timer_Stop(&dev->Timer);    if (Online(dev)) {      int dummy;      dummy = 1;      ioctl(p->fd, TIOCCDTR, &dummy);    }  }}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:15,


示例16: throughput_start

voidthroughput_start(struct pppThroughput *t, const char *name, int rolling){  int i;  timer_Stop(&t->Timer);  for (i = 0; i < t->SamplePeriod; i++)    t->in.SampleOctets[i] = t->out.SampleOctets[i] = 0;  t->nSample = 0;  t->OctetsIn = t->OctetsOut = t->PacketsIn = t->PacketsOut = 0;  t->in.OctetsPerSecond = t->out.OctetsPerSecond = t->BestOctetsPerSecond = 0;  time(&t->BestOctetsPerSecondTime);  t->downtime = 0;  time(&t->uptime);  throughput_restart(t, name, rolling);}
开发者ID:coyizumi,项目名称:cs111,代码行数:16,


示例17: radius_Continue

/* * We've either timed out or select()ed on the read descriptor */static voidradius_Continue(struct radius *r, int sel){  struct timeval tv;  int got;  timer_Stop(&r->cx.timer);  if ((got = rad_continue_send_request(r->cx.rad, sel, &r->cx.fd, &tv)) == 0) {    log_Printf(log_IsKept(LogRADIUS) ? LogRADIUS : LogPHASE,	       "Radius: Request re-sent/n");    r->cx.timer.load = tv.tv_usec / TICKUNIT + tv.tv_sec * SECTICKS;    timer_Start(&r->cx.timer);    return;  }  radius_Process(r, got);}
开发者ID:coyizumi,项目名称:cs111,代码行数:20,


示例18: SetSITimer

Status_e SetSITimer(void){	UINT16 timercontrol;#ifndef HW_SI_TIMER	timer_Data_t *timer_p;	UINT32 no_of_ticks;	if (SItimerID != 0xFFFFFFFF)	{//A timer already exists. Disable the existing timer		timer_Stop(SItimerID);		timer_Return(SItimerID);	}	if ((timer_p = timer_Get(&SI_TimeoutHdlr)) != NULL)	{		SItimerID = timer_p->Id;	}	else	{		return FAIL;	}#ifndef NEW_SCHEDULER	no_of_ticks = currentSI/10000;   /* how may 10 ms */#else	no_of_ticks = gGCD/10;   /* how may 10 ms */#endif	timer_Start(timer_p->Id, no_of_ticks, no_of_ticks);#else //HW_SI_TIMER	WL_READ_REGS16(TIMER_CONTROL, timercontrol);	//stop the timer	WL_WRITE_REGS16(TIMER_CONTROL, (timercontrol & (~TIMER1_ACTIVATE)));	//load the new counter val#ifndef NEW_SCHEDULER	WL_WRITE_REGS16(TIMER1_LEN, currentSI/1000);/** Set to the time you want in ms **/#else	WL_WRITE_REGS16(TIMER1_LEN, (gGCD/1000)-1);/** Set to the time you want in ms adjust for 1ms delay in timer expiry**/#endif	//W81_WRITE_REGS16(TIMER1_LEN, 5000);/** Set to the time you want in ms **/	//restart the timer. Make it a periodic timer	WL_WRITE_REGS16(TIMER_CONTROL, (timercontrol | TIMER1_AUTORST | TIMER1_ACTIVATE | TIMER1_LD_VAL));	//W81_WRITE_REGS16(TIMER_CONTROL, (timercontrol | TIMER1_ACTIVATE | TIMER1_LD_VAL));#endif //HW_SI_TIMER	//  timer_Start(timer_p->Id, 10, 10);//HARDCODE	return SUCCESS;}
开发者ID:7LK,项目名称:McWRT,代码行数:46,


示例19: throughput_restart

voidthroughput_restart(struct pppThroughput *t, const char *name, int rolling){  timer_Stop(&t->Timer);  t->rolling = rolling ? 1 : 0;  if (t->rolling) {    t->Timer.load = SECTICKS;    t->Timer.func = throughput_sampler;    t->Timer.name = name;    t->Timer.arg = t;    timer_Start(&t->Timer);  } else {    t->Timer.load = 0;    t->Timer.func = NULL;    t->Timer.name = NULL;    t->Timer.arg = NULL;  }}
开发者ID:coyizumi,项目名称:cs111,代码行数:18,


示例20: datalink_StartDialTimer

static intdatalink_StartDialTimer(struct datalink *dl, int Timeout){  int result = Timeout;  timer_Stop(&dl->dial.timer);  if (Timeout < 0)    result = (random() % DIAL_TIMEOUT) + 1;  dl->dial.timer.load = result ? result * SECTICKS : 1;  dl->dial.timer.func = datalink_OpenTimeout;  dl->dial.timer.name = "dial";  dl->dial.timer.arg = dl;  timer_Start(&dl->dial.timer);  if (dl->state == DATALINK_OPENING)    log_Printf(LogPHASE, "%s: Enter pause (%d) for redialing./n",               dl->name, result);  return result;}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:18,


示例21: i4b_device2iov

static voidi4b_device2iov(struct device *d, struct iovec *iov, int *niov,               int maxiov, int *auxfd, int *nauxfd){  struct i4bdevice *dev = device2i4b(d);  int sz = physical_MaxDeviceSize();  iov[*niov].iov_base = realloc(d, sz);  if (iov[*niov].iov_base == NULL) {    log_Printf(LogALERT, "Failed to allocate memory: %d/n", sz);    AbortProgram(EX_OSERR);  }  iov[*niov].iov_len = sz;  (*niov)++;  if (dev->Timer.state != TIMER_STOPPED) {    timer_Stop(&dev->Timer);    dev->Timer.state = TIMER_RUNNING;  }}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:20,


示例22: SendLqrReport

static voidSendLqrReport(void *v){  struct lcp *lcp = (struct lcp *)v;  struct physical *p = link2physical(lcp->fsm.link);  timer_Stop(&p->hdlc.lqm.timer);  if (p->hdlc.lqm.method & LQM_LQR) {    if (p->hdlc.lqm.lqr.resent > 5) {      /* XXX: Should implement LQM strategy */      log_Printf(LogPHASE, "%s: ** Too many LQR packets lost **/n",                lcp->fsm.link->name);      log_Printf(LogLQM, "%s: Too many LQR packets lost/n",                lcp->fsm.link->name);      p->hdlc.lqm.method = 0;      datalink_Down(p->dl, CLOSE_NORMAL);    } else {      SendLqrData(lcp);      p->hdlc.lqm.lqr.resent++;    }  } else if (p->hdlc.lqm.method & LQM_ECHO) {    if ((p->hdlc.lqm.echo.seq_sent > 5 &&         p->hdlc.lqm.echo.seq_sent - 5 > p->hdlc.lqm.echo.seq_recv) ||        (p->hdlc.lqm.echo.seq_sent <= 5 &&         p->hdlc.lqm.echo.seq_sent > p->hdlc.lqm.echo.seq_recv + 5)) {      log_Printf(LogPHASE, "%s: ** Too many LCP ECHO packets lost **/n",                lcp->fsm.link->name);      log_Printf(LogLQM, "%s: Too many LCP ECHO packets lost/n",                lcp->fsm.link->name);      p->hdlc.lqm.method = 0;      datalink_Down(p->dl, CLOSE_NORMAL);    } else      SendEchoReq(lcp);  }  if (p->hdlc.lqm.method && p->hdlc.lqm.timer.load)    timer_Start(&p->hdlc.lqm.timer);}
开发者ID:2asoft,项目名称:freebsd,代码行数:38,



注:本文中的timer_Stop函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ timer_adjust函数代码示例
C++ timerStart函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。