示例#1
0
文件: common.c 项目: videolan/vlc
void CommonWindowClean(vlc_object_t *obj, vout_display_sys_win32_t *sys)
{
    if (sys->event) {
        CommonChangeThumbnailClip(obj, sys, false);
        EventThreadStop(sys->event);
        EventThreadDestroy(sys->event);
    }
}
示例#2
0
文件: common.c 项目: BossKing/vlc
void CommonClean(vout_display_t *vd)
{
    vout_display_sys_t *sys = vd->sys;
    if (sys->event) {
        CommonChangeThumbnailClip(vd, false);
        EventThreadStop(sys->event);
        EventThreadDestroy(sys->event);
    }

    RestoreScreensaver(vd);
}
示例#3
0
文件: common.c 项目: paa/vlc
void CommonClean(vout_display_t *vd)
{
    vout_display_sys_t *sys = vd->sys;

    if (sys->event) {
        CommonChangeThumbnailClip(vd, false);
        EventThreadStop(sys->event);
        EventThreadDestroy(sys->event);
    }

#if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)
    RestoreScreensaver(vd);
#endif
}
示例#4
0
文件: common.c 项目: FLYKingdom/vlc
void CommonClean( vout_thread_t *p_vout )
{
    vout_sys_t *p_sys = p_vout->p_sys;

    ExitFullscreen( p_vout );
    if( p_sys->p_event )
    {
        EventThreadStop( p_sys->p_event );
        EventThreadDestroy( p_sys->p_event );
    }

    vlc_mutex_destroy( &p_sys->lock );

#if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)
    RestoreScreensaver( p_vout );
#endif
}
示例#5
0
文件: smamain.c 项目: 01org/opa-ff
FSTATUS
SmaAddDevice(
	IN	EUI64			CaGuid,
	OUT void			**Context
	)
{
	FSTATUS				status = FSUCCESS;
	SMA_CA_OBJ_PRIVATE	*pCaObj=NULL;
	uint32				i;
	
	_DBG_ENTER_LVL(_DBG_LVL_MAIN, SmaAddDevice);

	pCaObj = (SMA_CA_OBJ_PRIVATE*)MemoryAllocateAndClear(sizeof(SMA_CA_OBJ_PRIVATE), FALSE, SMA_MEM_TAG);
	if ( NULL == pCaObj ) 
	{
		_DBG_ERROR(("MemAlloc failed for pCaObj/WorkReq!\n"));
		status = FINSUFFICIENT_MEMORY;
		goto done;
	}

	pCaObj->CaPublic.CaGuid = CaGuid;
	pCaObj->CaPublic.SmaCaContext = pCaObj;

	EventThreadInitState(&pCaObj->SmaEventThread);
	if (! EventThreadCreate(&pCaObj->SmaEventThread, "Smi",
		THREAD_PRI_VERY_HIGH, SmaCompletionCallback, pCaObj))
	{
		_DBG_ERROR(("Sma Event Thread Create FAILED\n"));
		goto failsmathread;
	}
		
	EventThreadInitState(&pCaObj->GsaEventThread);
	if (! EventThreadCreate(&pCaObj->GsaEventThread, "Gsi",
		THREAD_PRI_VERY_HIGH, GsaCompletionThreadCallback, pCaObj))
	{
		_DBG_ERROR(("Gsa Event Thread Create FAILED\n"));
		goto failgsathread;
	}

	status = iba_open_ca( CaGuid, SmaGsaCompletionCallback,
				SmaAsyncEventCallback, pCaObj/*Context*/, &pCaObj->CaHandle);
	if ( FSUCCESS != status )
	{
		_DBG_ERROR(("OpenCA() failed!\n"));
		goto failopen;
	}
	status = SetCAInternal(pCaObj->CaHandle);
	if ( FSUCCESS != status )
	{
		_DBG_ERROR(("SetCAInternal() failed!\n"));
		goto failinternal;
	}

	// Reserve CQ/QP/PD...
	status = SmaDeviceReserve( pCaObj );
	if ( FSUCCESS != status )
	{
		goto failreserve;
	}
	// we hold the Mutex across Bind and addition to Ca list
	// so that CreateDgrmPool cannot race and cause double
	// registration of memory in new DgrmPool
	AcquireMemListMutex();
	status = SmaBindGlobalMem( pCaObj );
	if (status != FSUCCESS)
	{
		ReleaseMemListMutex();
		// TBD need to undo SmaDeviceReserve
		goto failreserve;
	}

	// lock

	// update global info
	SpinLockAcquire(&g_Sma->CaListLock);
	g_Sma->NumCa++;
	pCaObj->Next = g_Sma->CaObj;
	pCaObj->Prev = NULL;
	if ( NULL != g_Sma->CaObj )
		g_Sma->CaObj->Prev = pCaObj;
	g_Sma->CaObj = pCaObj;
	pCaObj->UseCount++;	// hold reference so we can use object below
	SpinLockRelease(&g_Sma->CaListLock);

	ReleaseMemListMutex();

	// QPConfig 
	status = SmaDeviceConfig( pCaObj, QPTypeSMI );
	status = SmaDeviceConfig( pCaObj, QPTypeGSI );

	// Create GSA data structures
	GsaUpdateCaList();

	// Preallocate Buffers based on per device.
	// If we know the amount of buffers we need per device and go ahead
	// and allocate them in advance, subnet sweeps will not allocate
	// any buffers in the speed path
	//
	// NOTE: This call can fail if there are no system resources
	SmaAllocToBin( g_Settings.PreAllocSMPsPerDevice, FALSE );
	
	// post some descriptors on recv side if port is up or something...
	for (i=0; i<pCaObj->CaPublic.Ports; i++)
	{
		status = iba_smi_post_recv( NULL, pCaObj, (uint8)(i+1), 
							g_Settings.MinSMPsToPostPerPort );	
	}

	// Set Port capabilities across all CA's
	SetPortCapabilities();

	// Rearm CQ to receive event notifications.
	// The next Work Completion written to the CQ 
	// will generate an event
	status = iba_rearm_cq( pCaObj->CqHandle, CQEventSelNextWC);						
	SpinLockAcquire(&g_Sma->CaListLock);
	pCaObj->UseCount--;
	SpinLockRelease(&g_Sma->CaListLock);

	// Bind 
		
	// unlock

	// notify users through callbacks!
	IbtNotifyGroup( CaGuid, IB_NOTIFY_CA_ADD );
	// TBD - failure above causes bad status return here, can confuse caller
	// also does not cleanup QPs, CQ, PD, MRs, buffers
	// SmaRemoveCaObj might solve, but not clear if safe to call it
	// need some peers to the SmaDeviceReserve and SmaDeviceConfig routines
	// to undo their effects

done:
	_DBG_LEAVE_LVL(_DBG_LVL_MAIN);
      
    return status;

failreserve:
failinternal:
	iba_close_ca( pCaObj->CaHandle );
failopen:
	EventThreadDestroy(&pCaObj->GsaEventThread);
failgsathread:
	EventThreadDestroy(&pCaObj->SmaEventThread);
failsmathread:
	MemoryDeallocate( pCaObj );
	goto done;
}