当前位置: 首页>>代码示例>>C++>>正文


C++ MUTEX_DESTROY函数代码示例

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


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


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