• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MUTEX_DESTROY函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MUTEX_DESTROY

Client::~Client(){
	MUTEX_DESTROY(mutex_sendto);
	MUTEX_DESTROY(mutex_print);
	TerminateThread(client_send_thread.ThreadHandle, 0);
	TerminateThread(client_recv_thread.ThreadHandle, 0);
	closesocket(mysocket);
}
开发者ID:jk983294,项目名称:Store,代码行数:7,代码来源:client.cpp


示例2: MUTEX_DESTROY

LoadBalancer::~LoadBalancer(){
	MUTEX_DESTROY(mutex_sendto);
	MUTEX_DESTROY(mutex_print);
	TerminateThread(pkt_thread.ThreadHandle, 0);
	TerminateThread(send_heartbeat_thread.ThreadHandle, 0);
	closesocket(client_socket);
	closesocket(server_socket);
}
开发者ID:jk983294,项目名称:Store,代码行数:8,代码来源:LoadBalancer.cpp


示例3: MUTEX_DESTROY

void
OMR::Monitor::destroy()
   {
#ifdef WIN32
   MUTEX_DESTROY(_monitor);
#else
   int32_t rc = MUTEX_DESTROY(_monitor);
   TR_ASSERT(rc == 0, "error destroying monitor\n");
#endif
   }
开发者ID:TianyuZuo,项目名称:omr,代码行数:10,代码来源:OMRMonitor.cpp


示例4: defined

void
OMR::Monitor::destroy()
   {
#if defined(OMR_OS_WINDOWS)
   MUTEX_DESTROY(_monitor);
#else
   int32_t rc = MUTEX_DESTROY(_monitor);
   TR_ASSERT(rc == 0, "error destroying monitor\n");
#endif /* defined(OMR_OS_WINDOWS) */
   }
开发者ID:hangshao0,项目名称:omr,代码行数:10,代码来源:OMRMonitor.cpp


示例5: xmap_clean

/* clean xmap */
void xmap_clean(XMAP *xmap)
{
    if(xmap)
    {
        //WARN_LOGGER(xmap->logger, "Ready clean tree[%p]", xmap->tree);
        mmtree_close(xmap->tree);
        //WARN_LOGGER(xmap->logger, "Ready clean tree64[%p]", xmap->tree64);
        mmtree64_close(xmap->tree64);
        //WARN_LOGGER(xmap->logger, "Ready clean queue[%p]", xmap->queue);
        mmqueue_clean(xmap->queue);
        //WARN_LOGGER(xmap->logger, "Ready clean kmap[%p]", xmap->kmap);
        mmtrie_clean(xmap->kmap);
        //WARN_LOGGER(xmap->logger, "Ready reset db[%p]", xmap->db);
        cdb_reset(xmap->db);
        //WARN_LOGGER(xmap->logger, "Ready clean db[%p]", xmap->db);
        cdb_clean(xmap->db);
        if(xmap->diskio.map)
        {
            munmap(xmap->diskio.map, xmap->diskio.size);
            xmap->diskio.map = NULL;
        }
        if(xmap->diskio.fd > 0)
        {
            close(xmap->diskio.fd);
            xmap->diskio.fd = 0;
        }
        if(xmap->metaio.map)
        {
            munmap(xmap->metaio.map, xmap->metaio.size);
            xmap->metaio.map = NULL;
        }
        if(xmap->metaio.fd > 0)
        {
            close(xmap->metaio.fd);
            xmap->metaio.fd = 0;
        }
        if(xmap->stateio.map)
        {
            munmap(xmap->stateio.map, xmap->stateio.size);
            xmap->stateio.map = NULL;
        }
        if(xmap->stateio.fd > 0)
        {
            close(xmap->stateio.fd);
            xmap->stateio.fd = 0;
        }
        //WARN_LOGGER(xmap->logger, "Ready clean mutex[%p]", xmap->mutex);
        MUTEX_DESTROY(xmap->mutex);
        MUTEX_DESTROY(xmap->cmutex);
        LOGGER_CLEAN(xmap->logger);
        xmm_free(xmap, sizeof(XMAP));
    }
    return ;
}
开发者ID:sounos,项目名称:hidbase,代码行数:55,代码来源:xmap.c


示例6: freerdp_chanman_uninit

int
freerdp_chanman_uninit(void)
{
	while (g_chan_man_list)
	{
		freerdp_chanman_free(g_chan_man_list->chan_man);
	}

	MUTEX_DESTROY(g_mutex_init);
	MUTEX_DESTROY(g_mutex_list);

	return 0;
}
开发者ID:g-reno,项目名称:FreeRDP-old,代码行数:13,代码来源:libchanman.c


示例7: ams_Destroy

  int
ams_Destroy(ams_p ams)
{
  MUTEX_DESTROY(ams->runflag_lock);
  free(ams->runflag_lock);
  COND_DESTROY(ams->runflag_cond);
  free(ams->runflag_cond);
  MUTEX_DESTROY(ams->waiting_lock);
  free(ams->waiting_lock);
  COND_DESTROY(ams->waiting_cond);
  free(ams->waiting_cond);
  free(ams);
  return MC_SUCCESS;
}
开发者ID:54madao,项目名称:Mobile-C,代码行数:14,代码来源:ams.c


示例8: ippr_raudio_fini

void ippr_raudio_fini()
{
	if (raudio_proxy_init == 1) {
		MUTEX_DESTROY(&raudiofr.fr_lock);
		raudio_proxy_init = 0;
	}
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:7,代码来源:ip_raudio_pxy.c


示例9: ArchiveClose

/*---------------------------------------------------------------------*/
BOOL ArchiveClose(H_ARCHIVE harchive)
{
    NODE *node;
    STREAM *stream;

    if (!ValidateHandle(harchive))
        return (FALSE);

    _archive[harchive].last_error = ARC_NO_ERROR;
    _archive_error = ARC_NO_ERROR;

    ArchiveLog(ARC_LOG_VERBOSE, "Close archive: %s", _archive[harchive].path);

    /* Close all open event files on archive... */
    if ((node = FirstNode(&_archive[harchive].streams))) {
        do {
            stream = (STREAM *) node->data;
            if (_archive[harchive].access == ARC_WRITE)
                CloseEventFileAndRename(harchive, stream);
            else
                CloseEventFile(stream);
        } while ((node = NextNode(node)) != NULL);
    }

    /* If open for write... */
    if (_archive[harchive].access == ARC_WRITE) {
        MUTEX_LOCK(&_archive[harchive].purge.mutex);
        if(_archive[harchive].purge.active ) {
            _archive[harchive].purge.stop = TRUE;
            MUTEX_UNLOCK(&_archive[harchive].purge.mutex);
            ArchiveLog(ARC_LOG_VERBOSE, "Stopping purge thread");
            SEM_POST(&_archive[harchive].purge.semaphore);
            THREAD_JOIN(&_archive[harchive].purge.thread_id);
        }
        else 
            MUTEX_UNLOCK(&_archive[harchive].purge.mutex);

        /* Mark as closed and write state to disk */
        _archive[harchive].state.write = FALSE;
        if (!WriteState(harchive))
            return (FALSE);
    }

    /* Close the state file */
    if (!FileClose(_archive[harchive].file)) {
        _archive[harchive].last_error = ARC_FILE_IO_ERROR;
        return (FALSE);
    }

    _n_archives--;

    /* Clear state */
    MUTEX_DESTROY(&_archive[harchive].mutex);
    DestroyList(&_archive[harchive].streams);
    DestroyPurge(&_archive[harchive].purge);

    InitArchive(harchive);

    return (TRUE);
}
开发者ID:Fran89,项目名称:seiscomp3,代码行数:61,代码来源:open.c


示例10: ippr_rcmd_fini

void ippr_rcmd_fini()
{
	if (rcmd_proxy_init == 1) {
		MUTEX_DESTROY(&rcmdfr.fr_lock);
		rcmd_proxy_init = 0;
	}
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:7,代码来源:ip_rcmd_pxy.c


示例11: omrthread_monitor_enter

/**
 * Discards a lock object.
 * An lock must be discarded to free the resources associated with it.
 * 
 * @note  A lock must not be destroyed if threads are waiting on it, or 
 * if it is currently owned.
 */
void
MM_LightweightNonReentrantLock::tearDown()
{
	if(NULL != _extensions) {
		if(NULL != _tracing) {
			if (NULL != _tracing->monitor_name) {
				_tracing->monitor_name = NULL;
			}

			J9Pool* tracingPool = _extensions->_lightweightNonReentrantLockPool;
			if(NULL != tracingPool) {
				omrthread_monitor_enter(_extensions->_lightweightNonReentrantLockPoolMutex);
				pool_removeElement(tracingPool, _tracing);
				omrthread_monitor_exit(_extensions->_lightweightNonReentrantLockPoolMutex);
			}
			_tracing = NULL;
		}
	}

	if (_initialized) {
#if defined(J9MODRON_USE_CUSTOM_SPINLOCKS)
		omrgc_spinlock_destroy(&_spinlock);
#else /* J9MODRON_USE_CUSTOM_SPINLOCKS */
		MUTEX_DESTROY(_mutex);
#endif /* J9MODRON_USE_CUSTOM_SPINLOCKS */
		_initialized = false;
	}
}
开发者ID:LinHu2016,项目名称:omr,代码行数:35,代码来源:LightweightNonReentrantLock.cpp


示例12: xqueue_clean

void xqueue_clean(void *xqueue)
{
    XQUEUE *q = (XQUEUE *)xqueue;
    XQNODE *node = NULL;
    int i = 0;

    if(q)
    {
        //fprintf(stdout, "%s::%d q:%p nleft:%d qtotal:%d qleft:%p\n", __FILE__, __LINE__, q, q->nleft, q->qtotal, q->left);
        for(i = 0; i < q->nlist; i++);
        {
            if(q->list[i]) 
                xmm_free(q->list[i], XQ_NODES_MAX * sizeof(XQNODE));
        }
        /*
       while((node = q->left))
       {
           q->left = node->next;
           xmm_free(node, sizeof(XQNODE));
       }
       */
        MUTEX_DESTROY(q->mutex);
        xmm_free(q, sizeof(XQUEUE));
    }
    return ;
}
开发者ID:5bruce,项目名称:sbase,代码行数:26,代码来源:xqueue.c


示例13: TEST

TEST(Mutex, test) {
    MUTEX mx;
    MUTEX_INIT(mx);
    MUTEX_LOCK(mx);
    MUTEX_UNLOCK(mx);
    MUTEX_DESTROY(mx);
}
开发者ID:leonindy,项目名称:cat,代码行数:7,代码来源:test_concurrent.cpp


示例14: ippr_netbios_fini

void ippr_netbios_fini()
{
	if (netbios_proxy_init == 1) {
		MUTEX_DESTROY(&netbiosfr.fr_lock);
		netbios_proxy_init = 0;
	}
}
开发者ID:andreiw,项目名称:polaris,代码行数:7,代码来源:ip_netbios_pxy.c


示例15: ippr_irc_fini

void ippr_irc_fini()
{
	if (irc_proxy_init == 1) {
		MUTEX_DESTROY(&ircnatfr.fr_lock);
		irc_proxy_init = 0;
	}
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:7,代码来源:ip_irc_pxy.c


示例16: dbg_deinit

void dbg_deinit()
{
    if (MUTEX_DESTROY(&(dbg_g->dbg_fd_out_lock)) != 0) {
        dbg_exit(EC__EXIT__NO_RECOVER);
    }
    free(dbg_g);
}
开发者ID:schanur,项目名称:octree-raytracer,代码行数:7,代码来源:debug.c


示例17: S_queue_destroy

void S_queue_destroy(pTHX_ message_queue* queue) {
	MUTEX_LOCK(&queue->mutex);
	node_destroy(&queue->front);
	COND_DESTROY(&queue->condvar);
	MUTEX_UNLOCK(&queue->mutex);
	MUTEX_DESTROY(&queue->mutex);
}
开发者ID:Leont,项目名称:thread-channel,代码行数:7,代码来源:queue.c


示例18: endAllocation

void endAllocation( void )
	{
	/* Destroy any data structures required to make the allocation thread-
	   safe */
	MUTEX_DESTROY( allocation );

	krnlData = NULL;
	}
开发者ID:VlaBst6,项目名称:cryptlib-history,代码行数:8,代码来源:sec_mem.c


示例19: ipf_p_raudio_main_unload

void
ipf_p_raudio_main_unload()
{
	if (raudio_proxy_init == 1) {
		MUTEX_DESTROY(&raudiofr.fr_lock);
		raudio_proxy_init = 0;
	}
}
开发者ID:MattDooner,项目名称:freebsd-west,代码行数:8,代码来源:ip_raudio_pxy.c


示例20: ipf_p_pptp_main_unload

void
ipf_p_pptp_main_unload(void)
{
	if (pptp_proxy_init == 1) {
		MUTEX_DESTROY(&pptpfr.fr_lock);
		pptp_proxy_init = 0;
	}
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:8,代码来源:ip_pptp_pxy.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MUTEX_ENTER函数代码示例发布时间:2022-05-30
下一篇:
C++ MUSB_HST_MODE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap