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


C++ DeleteLock函数代码示例

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


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

示例1: main

int
main()
{
	int lock3,mv3,cv3;

	lock3 = CreateLock("lock3",5);
	cv3 = CreateCV("cv3",3);
	mv3 = CreateMV("mv3",3,5);

	WriteToConsole("\nAcquiring lock3 in rpcclient5\n\0", -1, -1, -1);
	if((Acquire("lock3",5)) == -1){
		WriteToConsole("Error acquiring lock3 in rpcclient5\n\0",-1,-1,-1);
		Exit(0);
	}

	if((Wait("cv3",3, "lock3",5)) == -1){
			WriteToConsole("Error waiting on cv3 and lock3 in rpcClient1\n\0",-1,-1,-1);
			Exit(0);
	}

	WriteToConsole("\nGot Signal on cv3 lock3 from rpcClient1\n\0", -1, -1, -1);
	WriteToConsole("\nValue of mv3 index 3 set by rpcClient1 is %d\n\0", GetMV("mv3",3,3), -1, -1);
	Release("lock3",5);

	DeleteLock("lock3",5);
	WriteToConsole(" Deleted Lock3\n\0",-1,-1,-1);
	DeleteMV("mv3",3);
	WriteToConsole(" Deleted MV3\n\0",-1,-1,-1);
	DeleteCV("cv3",3);
	WriteToConsole(" Deleted CV3\n\0",-1,-1,-1);

	Exit(0);
}
开发者ID:aprabhudesai,项目名称:OperatingSystems,代码行数:33,代码来源:rpcTest5.c

示例2: NiFreeNat

// Release the NAT
void NiFreeNat(NAT *n)
{
	// Validate arguments
	if (n == NULL)
	{
		return;
	}

	// Complete management command
	//NiFreeAdminAccept(n);

	// Stop if the virtual host is running
	Lock(n->lock);
	{
		if (n->Virtual != NULL)
		{
			StopVirtualHost(n->Virtual);
			ReleaseVirtual(n->Virtual);
			n->Virtual = NULL;
		}
	}
	Unlock(n->lock);

	// Release the settings
	NiFreeConfig(n);

	// Delete the object
	ReleaseCedar(n->Cedar);
	ReleaseEvent(n->HaltEvent);
	DeleteLock(n->lock);

	Free(n);
}
开发者ID:benapetr,项目名称:SoftEtherVPN,代码行数:34,代码来源:Nat.c

示例3: finish_segmgr

/*
 * End segment manager
 */
EXPORT ER finish_segmgr( void )
{
	ER	ercd, ret = E_OK;

	/* Finish system exception manager */
	ercd = finish_excmgr();
	if ( ercd < E_OK ) {
		ret = ercd;
	}

	/* Delete subsystem registration */
	ercd = tk_def_ssy(SEG_SVC, NULL);
	if ( ercd < E_OK ) {
		ret = ercd;
	}

	/* Remove segment manager lock */
	DeleteLock(&SegLock);

#ifdef DEBUG
	if ( ret < E_OK ) {
		TM_DEBUG_PRINT(("finish_segmgr ercd = %d\n", ret));
	}
#endif
	return ret;
}
开发者ID:Ninals-GitHub,项目名称:TRON,代码行数:29,代码来源:segmgr.c

示例4: FOREACH_FIRST

void ShardLockManager::OnRemoveCachedLocks()
{
    uint64_t    now;
    ShardLock*  lock;

    now = EventLoop::Now();

    FOREACH_FIRST(lock, lockCacheList)
    {
        // should be unlocked
        ASSERT(!lock->locked);
        // session should be NULL
        ASSERT(lock->session == NULL);
        // not in lock expiry list
        ASSERT(lock->listExpiryNode.next == lock);
        // not in lock pool list
        ASSERT(lock->listPoolNode.next == lock);
        // in tree
        ASSERT(lock->treeNode.IsInTree());

        if (lock->unlockTime < now || lockCacheList.GetLength() > maxCacheCount)
        {
            lockTree.Remove(lock);
            lockCacheList.Remove(lock);
            DeleteLock(lock);
        }
        else
            break;
    }
开发者ID:scalien,项目名称:scaliendb,代码行数:29,代码来源:ShardLockManager.cpp

示例5: CleanupL3Sw

// Clean-up the L3 switch
void CleanupL3Sw(L3SW *s)
{
	UINT i;
	// Validate arguments
	if (s == NULL)
	{
		return;
	}

	for (i = 0;i < LIST_NUM(s->IfList);i++)
	{
		L3IF *f = LIST_DATA(s->IfList, i);
		Free(f);
	}
	ReleaseList(s->IfList);

	for (i = 0;i < LIST_NUM(s->TableList);i++)
	{
		L3TABLE *t = LIST_DATA(s->TableList, i);
		Free(t);
	}
	ReleaseList(s->TableList);

	DeleteLock(s->lock);
	Free(s);
}
开发者ID:BIGbozi,项目名称:SoftEtherVPN,代码行数:27,代码来源:Layer3.c

示例6: CleanupUser

// Cleanup the user object 
void CleanupUser(USER *u)
{
	// Validate arguments
	if (u == NULL)
	{
		return;
	}

	DeleteLock(u->lock);
	Free(u->Name);
	Free(u->RealName);
	Free(u->Note);
	Free(u->GroupName);
	if (u->Group != NULL)
	{
		ReleaseGroup(u->Group);
	}

	// Free authntication data
	FreeAuthData(u->AuthType, u->AuthData);

	if (u->Policy)
	{
		// Free policy data
		Free(u->Policy);
	}

	FreeTraffic(u->Traffic);

	Free(u);
}
开发者ID:AlexeyBychkov,项目名称:SoftEtherVPN,代码行数:32,代码来源:Account.c

示例7: FreeDynamicListener

// Release the dynamic listener
void FreeDynamicListener(DYNAMIC_LISTENER *d)
{
	// Validate arguments
	if (d == NULL)
	{
		return;
	}

	Lock(d->Lock);
	{
		if (d->Listener != NULL)
		{
			StopListener(d->Listener);
			ReleaseListener(d->Listener);
			d->Listener = NULL;
		}
	}
	Unlock(d->Lock);

	ReleaseCedar(d->Cedar);

	DeleteLock(d->Lock);

	Free(d);
}
开发者ID:1nv4d3r5,项目名称:SoftEtherVPN,代码行数:26,代码来源:Listener.c

示例8: main

void main()
{
	int lck1,cv1;
	
	Print("\nTC1_1 :: Checking Correct Working of Creating & Deleting of Locks and CV.\n",1,1,1);

	lck1 = CreateLock("lock1", 5);			
	Print("\nTC1_1 :: Lock name 'lock1' Created. The Index is '%d'.\n",lck1,1,1);
	
	cv1 = CreateCV("cv1", 3);				
	Print("\nTC1_1 :: CV name 'cv1' Created. The Index is '%d'.\n",cv1,1,1);
	
	Acquire(lck1);							
	
	Print("\nTC1_1 :: Going on wait on 'cv1' using 'lock1'. Now run the 'tc1_2' file.\n",1,1,1);
	Wait(cv1,lck1);
	Print("\nTC1_1 :: Have been signalled on 'cv1' using 'lock1'.\n",1,1,1);

	Release(lck1);							

	DeleteCV(cv1);						

	DeleteLock(lck1);	
	
	Print("\nTC1_1 :: Reached end.\n",lck1,1,1);
	Exit(0);
}
开发者ID:rmayur,项目名称:nachos-project-4-submitted,代码行数:27,代码来源:tc1_1.c

示例9: FreeTick64

// Release of the Tick64
void FreeTick64()
{
	UINT i;
	if (tk64 == NULL)
	{
		// Uninitialized
		return;
	}

	// Termination process
	tk64->Halt = true;
	Set(halt_tick_event);
	WaitThread(tk64->Thread, INFINITE);
	ReleaseThread(tk64->Thread);

	// Releasing process
	for (i = 0;i < LIST_NUM(tk64->AdjustTime);i++)
	{
		ADJUST_TIME *t = LIST_DATA(tk64->AdjustTime, i);
		Free(t);
	}
	ReleaseList(tk64->AdjustTime);
	DeleteLock(tk64->TickLock);
	Free(tk64);
	tk64 = NULL;

	ReleaseEvent(halt_tick_event);
	halt_tick_event = NULL;
}
开发者ID:13eatrice,项目名称:SoftEtherVPN,代码行数:30,代码来源:Tick64.c

示例10: main

void main()
{
    int lck1,cv1;

    Print("\nTC1_2 :: Checking Correct Working of Creating & Deleting of Locks and CV.\n",1,1,1);

    lck1 = CreateLock("lock1", 5);
    Print("\nTC1_2 :: Lock name 'lock1' Created. The Index is '%d'.\n",lck1,1,1);

    cv1 = CreateCV("cv1", 3);
    Print("\nTC1_2 :: CV name 'cv1' Created. The Index is '%d'.\n",cv1,1,1);

    Acquire(lck1);

    Print("\nTC1_2 :: Going to signal on 'cv1'. The waiter on 'cv1' will be woken up.\n",1,1,1);
    Signal(cv1,lck1);


    Release(lck1);

    DeleteCV(cv1);

    DeleteLock(lck1);

    Print("\nTC1_2 :: Reached end.\n",lck1,1,1);
    Exit(0);
}
开发者ID:rmayur,项目名称:nachos-project-4-submitted,代码行数:27,代码来源:tc1_2.c

示例11: CloseSec

// Close the secure device
void CloseSec(SECURE *sec)
{
	// Validate arguments
	if (sec == NULL)
	{
		return;
	}

	// Log out
	LogoutSec(sec);

	// Close the session
	CloseSecSession(sec);

	// Release the token information
	FreeSecInfo(sec);

	// Release of the slot list memory
	if (sec->SlotIdList != NULL)
	{
		Free(sec->SlotIdList);
		sec->SlotIdList = NULL;
	}

	// Unload the module
	FreeSecModule(sec);

	// Memory release
	DeleteLock(sec->lock);
	Free(sec);
}
开发者ID:13eatrice,项目名称:SoftEtherVPN,代码行数:32,代码来源:Secure.c

示例12: main

void main()
{
	int lck1,cv1=-1,lck2;
	
	Print("\nTC5_1 :: Checking Working of Wait and Signal. \n",1,1,1);

	lck1 = CreateLock("lock1", 5);			
	Print("\nTC5_1 :: Lock name 'lock1' Created. The Index is '%d'.\n",lck1,1,1);

	Acquire(lck1);							
	
	Print("\nTC5_1 :: Going on wait on 'cv1' that is not created using 'lock1'. Will not go on wait.\n",1,1,1);
	Wait(cv1,lck1);
	Print("\nERROR - TC5_1 :: Could not go on wait on 'cv1' using 'lock1'.\n",1,1,1);

	cv1 = CreateCV("cv1", 3);				
	Print("\nTC5_1 :: CV name 'cv1' Created. The Index is '%d'.\n",cv1,1,1);
	
	Print("\nTC5_1 :: Going on wait on 'cv1' that is now created using 'lock1'. Now run the 'tc5_2' file.\n",1,1,1);
	Wait(cv1,lck1);
	Print("\nTC5_1 :: Have been signalled on 'cv1' using 'lock1'.\n",1,1,1);

	Release(lck1);							

	DeleteCV(cv1);						

	DeleteLock(lck1);						
	
	Print("\nTC5_1 :: Reached end.\n",lck1,1,1);
	Exit(0);
}
开发者ID:rmayur,项目名称:nachos-project-4-submitted,代码行数:31,代码来源:tc5_1.c

示例13: main

void main()
{
	int lck1,cv1,lck2;
	
	Print("\nTC6_1 :: Checking Working of Wait and Signal. \n",1,1,1);

	lck1 = CreateLock("lock1", 5);			
	Print("\nTC6_1 :: Lock name 'lock1' Created. The Index is '%d'.\n",lck1,1,1);

	cv1 = CreateCV("cv1", 3);				
	Print("\nTC6_1 :: CV name 'cv1' Created. The Index is '%d'.\n",cv1,1,1);
	
	Acquire(lck1);												

	Print("\nTC6_1 :: Going on wait on 'cv1' using 'lock1' that is the correct lock (First Waiter). Will go on wait. Now run the 'tc6_2' file. \n",1,1,1);
	Wait(cv1,lck1);
	Print("\nTC6_1 :: Have been Signalled on 'cv1' using 'lock2'.\n",1,1,1);

	Release(lck1);							

	DeleteCV(cv1);						

	DeleteLock(lck1);						

	Print("\nTC6_1 :: Reached end.\n",lck1,1,1);
	Exit(0);
}
开发者ID:rmayur,项目名称:nachos-project-4-submitted,代码行数:27,代码来源:tc6_1.c

示例14: NiFreeNat

// NAT の解放
void NiFreeNat(NAT *n)
{
	// 引数チェック
	if (n == NULL)
	{
		return;
	}

	// 管理コマンド終了
	//NiFreeAdminAccept(n);

	// 仮想ホストが動作中の場合は停止
	Lock(n->lock);
	{
		if (n->Virtual != NULL)
		{
			StopVirtualHost(n->Virtual);
			ReleaseVirtual(n->Virtual);
			n->Virtual = NULL;
		}
	}
	Unlock(n->lock);

	// 設定の解放
	NiFreeConfig(n);

	// オブジェクトの削除
	ReleaseCedar(n->Cedar);
	ReleaseEvent(n->HaltEvent);
	DeleteLock(n->lock);

	Free(n);
}
开发者ID:falcon8823,项目名称:utvpn,代码行数:34,代码来源:Nat.c

示例15: dt_main

/*
 * Calendar functions entry
 */
EXPORT	ER	dt_main(INT ac, UB* av[])
{
	ER	er;
	T_DSSY	dssy;

	if (ac < 0) {
		/* Stop other tasks from executing SVC */
		Lock(&dtLock);

		/* Unregister subsystem */
		tk_def_ssy(DT_SVC, NULL);

		/* Delete lock */
		DeleteLock(&dtLock);
		return E_OK;
	}

	/* Create lock */
	er = CreateLock(&dtLock, "dtLk");
	if (er < E_OK) {
		goto err_ret0;
	}

	/* Register subsystem */
	dssy.ssyatr	= TA_NULL;
	dssy.ssypri	= DT_PRI;
	dssy.svchdr	= (FP)svcEntry;
	dssy.breakfn	= NULL;
	dssy.startupfn	= NULL;
	dssy.cleanupfn	= NULL;
	dssy.eventfn	= NULL;
	dssy.resblksz	= 0;
	er = tk_def_ssy(DT_SVC, &dssy);
	if (er < E_OK) {
		goto err_ret1;
	}

	return E_OK;

err_ret1:
	DeleteLock(&dtLock);
	
err_ret0:
	return er;
}
开发者ID:Ninals-GitHub,项目名称:TRON,代码行数:48,代码来源:service.c


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