예제 #1
0
BOOL cg_mutex_delete(CgMutex *mutex)
{
	if (!mutex)
		return FALSE;

	cg_log_debug_l4("Entering...\n");

#if defined(WIN32) && !defined(ITRON)
	CloseHandle(mutex->mutexID);
#elif defined(BTRON)
	del_sem(mutex->mutexID);
#elif defined(ITRON)
	del_sem(mutex->mutexID);
#elif defined(TENGINE) && !defined(PROCESS_BASE)
	tk_del_sem(mutex->mutexID);
#elif defined(TENGINE) && defined(PROCESS_BASE)
	b_del_sem(mutex->mutexID);
#else
	pthread_mutex_destroy(&mutex->mutexID);
#endif
	free(mutex);

	cg_log_debug_l4("Leaving...\n");

	return TRUE;
}
예제 #2
0
파일: mutex.c 프로젝트: WilliamRen/mupnpc
bool mupnp_mutex_delete(mUpnpMutex *mutex)
{
	if (!mutex)
		return false;

	mupnp_log_debug_l4("Entering...\n");

#if defined(WIN32) && !defined(ITRON)
	CloseHandle(mutex->mutexID);
#elif defined(BTRON)
	del_sem(mutex->mutexID);
#elif defined(ITRON)
	del_sem(mutex->mutexID);
#elif defined(TENGINE) && !defined(PROCESS_BASE)
	tk_del_sem(mutex->mutexID);
#elif defined(TENGINE) && defined(PROCESS_BASE)
	b_del_sem(mutex->mutexID);
#else
	pthread_mutex_destroy(&mutex->mutexID);
#endif
	free(mutex);

	mupnp_log_debug_l4("Leaving...\n");

	return true;
}
예제 #3
0
파일: thread.c 프로젝트: shidasan/konoha2
int knh_mutex_destroy(kmutex_t *m)
{
	//DBG_P("destroying %p", m);
#if defined(K_USING_PTHREAD)
	return pthread_mutex_destroy((pthread_mutex_t*)m);
#elif defined(K_USING_BTRON)
	W err = b_del_sem(*m);
	if (err < 0) {
		return -1;
	}
	return 0;
#elif defined(K_USED_TO_BE_ON_LKM)
	return 0;
#elif defined(K_USING_WINTHREAD_)
	DeleteCriticalSection(m);
	return 0;
#else
	return 0;
#endif
}