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

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

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

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

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

示例1: sys_timer_set

voidsys_timer_set( SysTimer  timer, SysTime  when, SysCallback   _callback, void*  opaque ){    QEMUTimerCB*  callback = (QEMUTimerCB*)_callback;    if (callback == NULL) {  /* unsetting the timer */        if (timer->timer) {            timer_del( timer->timer );            timer_free( timer->timer );            timer->timer = NULL;        }        timer->callback = callback;        timer->opaque   = NULL;        return;    }    if ( timer->timer ) {         if ( timer->callback == callback && timer->opaque == opaque )            goto ReuseTimer;         /* need to replace the timer */         timer_free( timer->timer );    }    timer->timer    = timer_new(QEMU_CLOCK_REALTIME, SCALE_MS, callback, opaque );    timer->callback = callback;    timer->opaque   = opaque;ReuseTimer:    timer_mod( timer->timer, when );}
开发者ID:Acidburn0zzz,项目名称:platform_external_qemu,代码行数:31,


示例2: main

intmain(int argc, char *argv[]){    pclu_context *pclu = pclu_create_context();    printf("/n%s/n", pclu_context_info(pclu));    matrix *aa = create_random_matrix(SIZE, SIZE);    matrix *bb = create_identity_matrix(SIZE, SIZE);#if PRINT_DATA    printf("Matrix aa:/n");    print_matrix(aa);    printf("/n");    printf("Matrix bb:/n");    print_matrix(bb);    printf("/n");#endif    timer* tt1 = timer_alloc();    matrix *cc = create_matrix(SIZE, SIZE);    matrix_multiply_cl(pclu, cc, aa, bb);        double tm1 = timer_read(tt1);    timer_free(tt1);        printf("Matrix_multiply_cl took %.04f seconds./n", tm1);#if PRINT_DATA    printf("Matrix cc:/n");    print_matrix(cc);    printf("/n");#endif    timer* tt = timer_alloc();    check_result(aa, cc);        double ct = timer_read(tt);    timer_free(tt);        printf("Check result took %.04f seconds./n", ct);    destroy_matrix(aa);    destroy_matrix(bb);    pclu_destroy_context(pclu);    return 0;}
开发者ID:NatTuck,项目名称:cakemark,代码行数:49,


示例3: conn_remove

voidconn_remove(const Conn_t *connection){  Conn_t *tmp, *prev;  assert(connection != NULL);  prev = NULL;  tmp = connlist;  while(tmp) {    if (tmp == connection) {      if (prev != NULL) {	prev->next = tmp->next;      } else {	connlist = tmp->next;      }      if (connection->fd) {	close(connection->fd);	event_remove_fd(connection->fd);      }      if (connection->sfd) {	event_remove_fd(connection->sfd);	close(connection->sfd);      }      timer_free(&conn_unit, tmp->timer);      mem_free(&conn_unit, tmp);      return;    }    prev = tmp;    tmp = tmp->next;  }}
开发者ID:earthGavinLee,项目名称:hg556a_source,代码行数:31,


示例4: ipmi_bmc_extern_finalize

static void ipmi_bmc_extern_finalize(Object *obj){    IPMIBmcExtern *ibe = IPMI_BMC_EXTERN(obj);    timer_del(ibe->extern_timer);    timer_free(ibe->extern_timer);}
开发者ID:8tab,项目名称:qemu,代码行数:7,


示例5: bdrv_qed_detach_aio_context

static void bdrv_qed_detach_aio_context(BlockDriverState *bs){    BDRVQEDState *s = bs->opaque;    qed_cancel_need_check_timer(s);    timer_free(s->need_check_timer);}
开发者ID:MauroZurita,项目名称:qemu,代码行数:7,


示例6: timer_enable

/* Enable a timer */static timer_id timer_enable(timer_entry_t *timer){   /* Allocate a new ID */   TIMER_LOCK();   timer->id = timer_alloc_id();   /* Insert ID in hash table */   if (hash_table_insert(timer_id_hash,&timer->id,timer) == -1) {      TIMER_UNLOCK();      free(timer);      return(0);   }   /* Schedule event */   if (timer_schedule(timer) == -1) {      timer_free(timer,FALSE);      timer = NULL;      TIMER_UNLOCK();      return(0);   }   /* Returns timer ID */   TIMER_UNLOCK();         pthread_cond_signal(&timer->queue->schedule);   return(timer->id);}
开发者ID:GNS3,项目名称:dynamips,代码行数:27,


示例7: fifo_output_close

static voidfifo_output_close(void *data){	struct fifo_data *fd = (struct fifo_data *)data;	timer_free(fd->timer);}
开发者ID:OpenInkpot-archive,项目名称:iplinux-mpd,代码行数:7,


示例8: _hwSensorClient_free

static void_hwSensorClient_free( HwSensorClient*  cl ){    /* remove from sensors's list */    if (cl->sensors) {        HwSensorClient**  pnode = &cl->sensors->clients;        for (;;) {            HwSensorClient*  node = *pnode;            if (node == NULL)                break;            if (node == cl) {                *pnode = cl->next;                break;            }            pnode = &node->next;        }        cl->next    = NULL;        cl->sensors = NULL;    }    /* close QEMUD client, if any */    if (cl->client) {        qemud_client_close(cl->client);        cl->client = NULL;    }    /* remove timer, if any */    if (cl->timer) {        timer_del(cl->timer);        timer_free(cl->timer);        cl->timer = NULL;    }    AFREE(cl);}
开发者ID:abhinavjayanthy,项目名称:GemDroid,代码行数:33,


示例9: timer_release

int timer_release(FAR struct posix_timer_s *timer){  /* Some sanity checks */  if (!timer)    {      return -EINVAL;    }  /* Release one reference to timer.  Don't delete the timer until the count   * would decrement to zero.   */  if (timer->pt_crefs > 1)    {      timer->pt_crefs--;      return 1;    }  /* Free the underlying watchdog instance (the timer will be canceled by the   * watchdog logic before it is actually deleted)   */  (void)wd_delete(timer->pt_wdog);  /* Release the timer structure */  timer_free(timer);  return OK;}
开发者ID:justdoitding,项目名称:Nuttx_PSoC4,代码行数:30,


示例10: port_test_output

/* * Configure PORT_1A as data with PORT_1B as the valid signal. Ensure that the * receiver is ready using a channel end. Send a word of data, delay for a while * and send another word to ensure the valid signals are functioning. */void port_test_output(chanend c){  port p = port_enable(XS1_PORT_1A);  port_set_buffered(p);  port_set_transfer_width(p, 32);  port p_ready = port_enable(XS1_PORT_1B);  clock clk = clock_enable(XS1_CLKBLK_1);  clock_start(clk);  port_configure_out_strobed_master(p, p_ready, clk, 0);  chan_input_word(c); // Wait for ack  port_output(p, 0xfeedbeef);  timer tmr = timer_alloc();  timer_delay(tmr, 1000);  timer_free(tmr);  port_output(p, 0x12345678);  chan_input_word(c); // Wait for ack  port_disable(p);  port_disable(p_ready);  clock_disable(clk);  // Get information about the tile/core running the server for debug messages  unsigned tile_id = get_local_tile_id();  unsigned core_id = get_logical_core_id();  debug_printf("%x:%d: output done/n", tile_id, core_id);}
开发者ID:choughtosh,项目名称:lib_xcore_c,代码行数:38,


示例11: wdt_diag288_unrealize

static void wdt_diag288_unrealize(DeviceState *dev, Error **errp){    DIAG288State *diag288 = DIAG288(dev);    timer_del(diag288->timer);    timer_free(diag288->timer);}
开发者ID:Distrotech,项目名称:qemu,代码行数:7,


示例12: main

int main (int argc, char *argv[])  {  timer *t = timer_alloc();  recorder *parent_rec = recorder_alloc("parent.csv");  recorder *child_rec = recorder_alloc("child.csv");  pid_t pid;  int status, i;  for (i = 0; i < N; i++) {    start_timer(t);    pid = fork();    if (pid == -1) {      // erreur à l'exécution de fork      perror("fork");      return EXIT_FAILURE;    }    // pas d'erreur    // BEGIN    if (pid == 0) {      // processus fils      write_record(child_rec, i, stop_timer(t));      recorder_free(child_rec);      recorder_free(parent_rec);      timer_free(t);      return EXIT_SUCCESS;    }    else {      // processus père      write_record(parent_rec, i, stop_timer(t));      pid = waitpid(pid, &status, 0);      if (pid == -1) {        perror("wait");        return EXIT_FAILURE;      }    }    // END  }  recorder_free(child_rec);  recorder_free(parent_rec);  timer_free(t);  return EXIT_SUCCESS;}
开发者ID:Mon-Ouie,项目名称:benchmark,代码行数:47,


示例13: nic_cleanup

static void nic_cleanup(NetClientState *ncs){#if 0    tnetw1130_t *s = qemu_get_nic_opaque(ncs);    timer_del(d->poll_timer);    timer_free(d->poll_timer);#endif}
开发者ID:stweil,项目名称:qemu,代码行数:8,


示例14: throttle_timer_destroy

/* destroy a timer */static void throttle_timer_destroy(QEMUTimer **timer){    assert(*timer != NULL);    timer_del(*timer);    timer_free(*timer);    *timer = NULL;}
开发者ID:artyom-tarasenko,项目名称:qemu,代码行数:9,


示例15: colo_compare_timer_del

static void colo_compare_timer_del(CompareState *s){    if (s->packet_check_timer) {        timer_del(s->packet_check_timer);        timer_free(s->packet_check_timer);        s->packet_check_timer = NULL;    } }
开发者ID:E8-Storage,项目名称:qemu,代码行数:8,


示例16: hid_del_idle_timer

static void hid_del_idle_timer(HIDState *hs){    if (hs->idle_timer) {        timer_del(hs->idle_timer);        timer_free(hs->idle_timer);        hs->idle_timer = NULL;    }}
开发者ID:Aakriti,项目名称:qemu,代码行数:8,


示例17: throttlePipe_close

static voidthrottlePipe_close( void* opaque ){    ThrottlePipe* pipe = opaque;    timer_del(pipe->timer);    timer_free(pipe->timer);    pingPongPipe_close(&pipe->pingpong);}
开发者ID:pras710,项目名称:qemu,代码行数:9,


示例18: icmp6_cleanup

void icmp6_cleanup(Slirp *slirp){    if (!slirp->in6_enabled) {        return;    }    timer_del(slirp->ra_timer);    timer_free(slirp->ra_timer);}
开发者ID:RodgerNO1,项目名称:qemu,代码行数:9,


示例19: end_resource_tracking

void end_resource_tracking(void){	/* call everyone who tracks resources to let them know */	auto_free();	timer_free();	/* decrement the tag counter */	resource_tracking_tag--;}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:9,


示例20: balloon_stats_destroy_timer

static void balloon_stats_destroy_timer(VirtIOBalloon *s){    if (balloon_stats_enabled(s)) {        timer_del(s->stats_timer);        timer_free(s->stats_timer);        s->stats_timer = NULL;        s->stats_poll_interval = 0;    }}
开发者ID:Kozzi11,项目名称:qemu,代码行数:9,


示例21: virtio_rng_device_unrealize

static void virtio_rng_device_unrealize(DeviceState *dev, Error **errp){    VirtIODevice *vdev = VIRTIO_DEVICE(dev);    VirtIORNG *vrng = VIRTIO_RNG(dev);    timer_del(vrng->rate_limit_timer);    timer_free(vrng->rate_limit_timer);    unregister_savevm(dev, "virtio-rng", vrng);    virtio_cleanup(vdev);}
开发者ID:01org,项目名称:qemu-lite,代码行数:10,


示例22: vhost_vsock_post_load_timer_cleanup

static void vhost_vsock_post_load_timer_cleanup(VHostVSock *vsock){    if (!vsock->post_load_timer) {        return;    }    timer_del(vsock->post_load_timer);    timer_free(vsock->post_load_timer);    vsock->post_load_timer = NULL;}
开发者ID:lukaszgemborowski,项目名称:qemu,代码行数:10,


示例23: baum_close

static void baum_close(struct CharDriverState *chr){    BaumDriverState *baum = chr->opaque;    timer_free(baum->cellCount_timer);    if (baum->brlapi) {        brlapi__closeConnection(baum->brlapi);        g_free(baum->brlapi);    }    g_free(baum);}
开发者ID:AnselZhangGit,项目名称:qemu_stm32,代码行数:11,


示例24: sys_timer_free

static voidsys_timer_free( SysTimer  timer ){    if (timer->timer) {        timer_del( timer->timer );        timer_free( timer->timer );        timer->timer = NULL;    }    timer->next    = _s_free_timers;    _s_free_timers = timer;}
开发者ID:Acidburn0zzz,项目名称:platform_external_qemu,代码行数:11,


示例25: destroy_dst_blacklist

void destroy_dst_blacklist(){	int r;	struct dst_blst_entry** crt;	struct dst_blst_entry* e;	if (blst_timer_h){		timer_del(blst_timer_h);		timer_free(blst_timer_h);		blst_timer_h=0;	}#ifdef BLST_LOCK_PER_BUCKET	if (dst_blst_hash)		for(r=0; r<DST_BLST_HASH_SIZE; r++)			lock_destroy(&dst_blst_hash[r].lock);#elif defined BLST_LOCK_SET		if (blst_lock_set){			lock_set_destroy(blst_lock_set);			lock_set_dealloc(blst_lock_set);			blst_lock_set=0;		}#else	if (blst_lock){		lock_destroy(blst_lock);		lock_dealloc(blst_lock);		blst_lock=0;	}#endif	if (dst_blst_hash){		for(r=0; r<DST_BLST_HASH_SIZE; r++){			crt=&dst_blst_hash[r].first;			while(*crt){				e=*crt;				*crt=(*crt)->next;				blst_destroy_entry(e);			}		}		shm_free(dst_blst_hash);		dst_blst_hash=0;	}	if (blst_mem_used){		shm_free((void*)blst_mem_used);		blst_mem_used=0;	}#ifdef DST_BLACKLIST_HOOKS	destroy_blacklist_hooks();#endif#ifdef USE_DST_BLACKLIST_STATS	if (dst_blacklist_stats)		shm_free(dst_blacklist_stats);#endif}
开发者ID:BackupTheBerlios,项目名称:ser,代码行数:54,


示例26: timer_close

voidtimer_close(timer_t *t){	if (t == NULL) return;	if (t->t_src != NULL) dispatch_source_cancel(t->t_src);	/*	 * We need to make sure that the source's event handler isn't currently running	 * before we free the timer.  We let the source's queue do the actual free.	 */	dispatch_async(t->t_queue, ^{ timer_free(t); });
开发者ID:010001111,项目名称:darling,代码行数:12,


示例27: openal_close

static voidopenal_close(void *data){	struct openal_data *od = data;	timer_free(od->timer);	alcMakeContextCurrent(od->context);	alDeleteSources(1, &od->source);	alDeleteBuffers(NUM_BUFFERS, od->buffers);	alcDestroyContext(od->context);	alcCloseDevice(od->device);}
开发者ID:OpenInkpot-archive,项目名称:iplinux-mpd,代码行数:12,


示例28: timer_cancelall

void timer_cancelall(FIFO* fifo) {  int e = io_load_eflags();  io_cli();  for (int i = 0; i < MAX_TIMER; ++i) {    TIMER* t = &timerctl.timers0[i];    if (t->flags != 0 && t->flags2 != 0 && t->fifo == fifo) {      timer_cancel(t);      timer_free(t);    }  }  io_store_eflags(e);}
开发者ID:tyfkda,项目名称:haribote,代码行数:12,


示例29: wind_timer_destroy

w_err_t wind_timer_destroy(w_timer_s* timer){    w_err_t err;    WIND_ASSERT_RETURN(timer != W_NULL,W_ERR_PTR_NULL);    WIND_ASSERT_RETURN(timer->obj.magic == WIND_TIMER_MAGIC,W_ERR_INVALID);        wind_notice("destroy timer:%s",timer->obj.name != W_NULL?timer->obj.name:"null");    err = wind_obj_deinit(&timer->obj,WIND_TIMER_MAGIC,&timerlist);    WIND_ASSERT_RETURN(err == W_ERR_OK,W_ERR_FAIL);    if(IS_F_TIMER_POOL(timer))        timer_free(timer);    return W_ERR_OK;}
开发者ID:yzfcer,项目名称:wind-os,代码行数:12,


示例30: destroy_mod

static void destroy_mod(void) {	struct timer_action* a;	DEBUG(MODULE_NAME": destroy: destroying, pid=%d/n", getpid());	while (timer_actions) {		a = timer_actions;		if (a->link) {			timer_del(a->link);			timer_free(a->link);		}		timer_actions = a->next;		shm_free(a);	}}
开发者ID:BackupTheBerlios,项目名称:ser,代码行数:13,



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


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