您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ EXIT_CRITICAL_SECTION函数代码示例

51自学网 2021-06-01 20:36:08
  C++
这篇教程C++ EXIT_CRITICAL_SECTION函数代码示例写得很实用,希望能帮到您。

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

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

示例1: serialPortEnable

void serialPortEnable(bool xRxEnable, bool xTxEnable){    ENTER_CRITICAL_SECTION();    if( xRxEnable )    {        P1OUT &= ~BIT1;		// set to receive mode        IE1 |= URXIE0;    }    else    {    	IFG1 &= ~URXIFG0;   // Clear rx interrupt flag        IE1  &= ~URXIE0;    }    if(xTxEnable)    {        P1OUT |= BIT1;		// set to transmit mode    	IE1   |= UTXIE0;        IFG1  |= UTXIFG0;	// trigger 1st interrupt manually    }    else    {    	IFG1 &= ~UTXIFG0;   // Clear tx interrupt flag        IE1  &= ~UTXIE0;    }    EXIT_CRITICAL_SECTION();    return ;}
开发者ID:jrlee420,项目名称:M430Boot,代码行数:31,


示例2: WritePATable

// *************************************************************************************************// @fn          WritePATable// @brief       Write data to power table// @param       unsigned char value             Value to write// @return      none// *************************************************************************************************void WritePATable(unsigned char value){   unsigned char readbackPATableValue = 0;   u16 int_state;   ENTER_CRITICAL_SECTION(int_state);   while (readbackPATableValue != value)   {      while (!(RF1AIFCTL1 & RFINSTRIFG)) ;      RF1AINSTRW = 0x7E00 + value;      // PA Table write (burst)      while (!(RF1AIFCTL1 & RFINSTRIFG)) ;      RF1AINSTRB = RF_SNOP;     // reset pointer      while (!(RF1AIFCTL1 & RFINSTRIFG)) ;      RF1AINSTRB = 0xFE;        // PA Table read (burst)      while (!(RF1AIFCTL1 & RFDINIFG)) ;      RF1ADINB = 0x00;          //dummy write      while (!(RF1AIFCTL1 & RFDOUTIFG)) ;      readbackPATableValue = RF1ADOUT0B;      while (!(RF1AIFCTL1 & RFINSTRIFG)) ;      RF1AINSTRB = RF_SNOP;   }   EXIT_CRITICAL_SECTION(int_state);}
开发者ID:alkin,项目名称:tidecc,代码行数:36,


示例3: eMBRTUStop

/** ----------------------------------------------------------------------------------------------------------------------- eMBRTUStop -----------------------------------------------------------------------------------------------------------------------*   Event Handler for GPI module** 	@date       			DEC/02/2013* 	@author                         FW_DEV_2* 	@pre                            None* 	@return	 			None*************************************************************************************************************************/void eMBRTUStop( void ){    ENTER_CRITICAL_SECTION(  );    vMBPortSerialEnable( FALSE, FALSE );    vMBPortTimersDisable(  );    EXIT_CRITICAL_SECTION(  );}
开发者ID:ankit4970,项目名称:modbus_lpc1769,代码行数:19,


示例4: FddpPushJobItem

static BOOL FddpPushJobItem(FDD_JOB_ITEM *pJobItem){	BOOL bResult = TRUE;ENTER_CRITICAL_SECTION();	{		/* check up the remain space of Q */		if(m_JobItemQ.cnt >= FDD_JOB_ITEM_Q_SIZE) {			bResult = FALSE;			goto $exit;		}		/* process */		m_JobItemQ.cnt++;		m_JobItemQ.queue[m_JobItemQ.tail].type					= pJobItem->type;		m_JobItemQ.queue[m_JobItemQ.tail].sector				= pJobItem->sector;		m_JobItemQ.queue[m_JobItemQ.tail].numbers_of_sectors	= pJobItem->numbers_of_sectors;		m_JobItemQ.queue[m_JobItemQ.tail].pt_data				= pJobItem->pt_data;		m_JobItemQ.queue[m_JobItemQ.tail].thread				= pJobItem->thread;		m_JobItemQ.tail++;		if(m_JobItemQ.tail >= FDD_JOB_ITEM_Q_SIZE)			m_JobItemQ.tail = 0;	}$exit:EXIT_CRITICAL_SECTION();	return bResult;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:27,


示例5: uxos_update_sysclock

static void uxos_update_sysclock(){	uint16_t temp_overflow_count;	ENTER_CRITICAL_SECTION();	temp_overflow_count=uxos_get_overflow();	EXIT_CRITICAL_SECTION();	if (temp_overflow_count>0)	{		ENTER_CRITICAL_SECTION();		uxos_clear_overflow();		EXIT_CRITICAL_SECTION();		uxos_timer_update(temp_overflow_count);	} 		}
开发者ID:wkxboot,项目名称:rtos,代码行数:16,


示例6: FddpPopJobItem

static BOOL FddpPopJobItem(FDD_JOB_ITEM *pJobItem){	BOOL bResult = TRUE;ENTER_CRITICAL_SECTION();	{		/* check up count */		if(m_JobItemQ.cnt == 0) {			bResult = FALSE;			goto $exit;		}		/* process */		m_JobItemQ.cnt--;		pJobItem->type					= m_JobItemQ.queue[m_JobItemQ.head].type;		pJobItem->sector				= m_JobItemQ.queue[m_JobItemQ.head].sector;		pJobItem->numbers_of_sectors	= m_JobItemQ.queue[m_JobItemQ.head].numbers_of_sectors;		pJobItem->pt_data				= m_JobItemQ.queue[m_JobItemQ.head].pt_data;		pJobItem->thread				= m_JobItemQ.queue[m_JobItemQ.head].thread;		m_JobItemQ.head++;		if(m_JobItemQ.head >= FDD_JOB_ITEM_Q_SIZE)			m_JobItemQ.head = 0;	}$exit:EXIT_CRITICAL_SECTION();	return bResult;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:27,


示例7: eMBRTUInit

/** * Initialize ModBus master. * * @param ucSlaveAddress - Not used in master mode * @param ucPort - Serial port number * @param ulBaudRate - Serial port baud rate * @param eParity -  MB_PAR_NONE, MB_PAR_ODD, MB_PAR_EVEN * @return MB_ENOERR on success */eMBErrorCode eMBRTUInit(UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate,        eMBParity eParity){    eMBErrorCode    eStatus = MB_ENOERR;    ULONG           ulTimerT35_50us;    ( void )ucSlaveAddress;    ENTER_CRITICAL_SECTION(  );    /* Modbus RTU uses 8 Databits. */    if( xMBPortSerialInit( ucPort, ulBaudRate, 8, eParity ) != TRUE )    {        eStatus = MB_EPORTERR;    }    if( ulBaudRate > 19200 )    {        /* The timer reload value for a character is given by:         *         * ChTimeValue = Ticks_per_1s / ( Baudrate / 11 )         *             = 11 * Ticks_per_1s / Baudrate         *             = 220000 / Baudrate         * The reload for t3.5 is 1.5 times this value and similarly         * for t3.5.         */         ulTimerT35_50us = ( 7UL * 220000UL ) / ( 2UL * ulBaudRate );    }    DEBUG_PUTSTRING1("T35 = ", ulTimerT35_50us);    if( xMBPortTimersInit( ( USHORT ) ulTimerT35_50us ) != TRUE )    {         eStatus = MB_EPORTERR;    }    EXIT_CRITICAL_SECTION(  );    return eStatus;}
开发者ID:jgobuyan,项目名称:bootloader,代码行数:43,


示例8: eMBRTUReceive

eMBErrorCodeeMBRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength ){    BOOL            xFrameReceived = FALSE;    eMBErrorCode    eStatus = MB_ENOERR;    ENTER_CRITICAL_SECTION();    assert( usRcvBufferPos < MB_SER_PDU_SIZE_MAX );    /* Length and CRC check */    if( ( usRcvBufferPos >= MB_SER_PDU_SIZE_MIN )        && ( usMBCRC16( ( UCHAR * ) ucRTUBuf, usRcvBufferPos ) == 0 ) )    {        /* Save the address field. All frames are passed to the upper layed         * and the decision if a frame is used is done there.         */        *pucRcvAddress = ucRTUBuf[MB_SER_PDU_ADDR_OFF];        /* Total length of Modbus-PDU is Modbus-Serial-Line-PDU minus         * size of address field and CRC checksum.         */        *pusLength = ( USHORT )( usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_CRC );        /* Return the start of the Modbus PDU to the caller. */        *pucFrame = ( UCHAR * ) & ucRTUBuf[MB_SER_PDU_PDU_OFF];        xFrameReceived = TRUE;    }    else    {        eStatus = MB_EIO;    }    EXIT_CRITICAL_SECTION();    return eStatus;}
开发者ID:zpcaams,项目名称:osm,代码行数:35,


示例9: vMBPortSerialEnable

/* ----------------------- Start implementation -----------------------------*/void vMBPortSerialEnable( BOOL xRxEnable, BOOL xTxEnable ){	/* If xRXEnable enable serial receive interrupts. If xTxENable enable	 * transmitter empty interrupts.	 */	ENTER_CRITICAL_SECTION(  );	if(xRxEnable){		//SciaRegs.SCICTL1.bit.RXENA = 1;		SciaRegs.SCICTL2.bit.RXBKINTENA =1;	}	else {		//SciaRegs.SCICTL1.bit.RXENA = 0;		SciaRegs.SCICTL2.bit.RXBKINTENA =0;	}	if(xTxEnable){		//SciaRegs.SCICTL1.bit.TXENA = 1;		SciaRegs.SCICTL2.bit.TXINTENA =1;		SciaRegs.SCICTL2.bit.TXEMPTY = 0;		SciaRegs.SCICTL1.bit.SWRESET = 0;		SciaRegs.SCICTL1.bit.SWRESET = 1;		//IFR = 0x0000;	}	else{		//SciaRegs.SCICTL1.bit.TXENA = 0;		SciaRegs.SCICTL2.bit.TXINTENA =0;	}	EXIT_CRITICAL_SECTION(  );}
开发者ID:niunuinui,项目名称:2833xFreeModbus,代码行数:30,


示例10: protocolSendPacket

void protocolSendPacket(uint8 *buf, uint8 len){    uint16	checksum;    if ( (len!=PDU_SIZE) || (g_serialPortRecvState!=STATE_RX_IDLE) )    {    	return ;    }    ENTER_CRITICAL_SECTION();	g_serialPortBufSendCnt = len;	g_serialPortSendPtr = g_serialPortBuf;	checksum = computeChecksum(buf, len-2);	buf[CSM_OFF] = (uint8)(checksum & 0xFF);    buf[CSM_OFF+1] = (uint8)(checksum >> 8);    g_serialPortSendState = STATE_TX_XMIT;    serialPortEnable(FALSE, TRUE);    EXIT_CRITICAL_SECTION();    return ;}
开发者ID:jrlee420,项目名称:M430Boot,代码行数:25,


示例11: eMBMasterRTUReceive

/************************************************************************* * eMBMasterRTUReceive * Функция приёма данных и проверка их целосности. *************************************************************************/eMBErrorCodeeMBMasterRTUReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, USHORT * pusLength ){    eMBErrorCode    eStatus = MB_ENOERR;    ENTER_CRITICAL_SECTION(  );    assert_param( usMasterRcvBufferPos < MB_SER_PDU_SIZE_MAX );    // Проверка длинны пакета и его CRC    if( ( usMasterRcvBufferPos >= MB_SER_PDU_SIZE_MIN )        && ( usMBCRC16( ( UCHAR * ) ucMasterRTURcvBuf, usMasterRcvBufferPos ) == 0 ) )    {        // Save the address field. All frames are passed to the upper layed and the decision if a frame is used is done there.        *pucRcvAddress = ucMasterRTURcvBuf[MB_SER_PDU_ADDR_OFF];        // Общая длина данных(Modbus-PDU) без поля адреса и CRC.        *pusLength = ( USHORT )( usMasterRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_CRC );        // Адрес начала данных(Modbus-PDU)        *pucFrame = ( UCHAR * ) & ucMasterRTURcvBuf[MB_SER_PDU_PDU_OFF];    }    else    {        eStatus = MB_EIO;    }    EXIT_CRITICAL_SECTION(  );    return eStatus;}
开发者ID:bearxiong99,项目名称:SmI_IEC104,代码行数:33,


示例12: eMBMasterRTUStop

voideMBMasterRTUStop( void ){		OS_CPU_SR  cpu_sr;    ENTER_CRITICAL_SECTION(  );    vMBMasterPortSerialEnable( FALSE, FALSE );    vMBMasterPortTimersDisable(  );    EXIT_CRITICAL_SECTION(  );}
开发者ID:goodfuture,项目名称:GasSub_LPC1788,代码行数:9,


示例13: eMBASCIIStop

voideMBASCIIStop( void ){	  ENTER_CRITICAL_DECLARE( );	    ENTER_CRITICAL_SECTION(  );    vMBPortSerialEnable( FALSE, FALSE );    vMBPortTimersDisable(  );    EXIT_CRITICAL_SECTION(  );}
开发者ID:WillJason,项目名称:cortex-M-Serise,代码行数:10,


示例14: PsGetCurrentThread

KERNELAPI HANDLE PsGetCurrentThread(VOID){	HANDLE thread;ENTER_CRITICAL_SECTION();	thread = (HANDLE)(m_ProcMgrBlk.pt_current_thread);EXIT_CRITICAL_SECTION();	return thread;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:10,


示例15: PspGetNextProcessID

static DWORD PspGetNextProcessID(void){	DWORD process_id;ENTER_CRITICAL_SECTION();	process_id = m_ProcMgrBlk.next_process_id++;EXIT_CRITICAL_SECTION();	return process_id;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:10,


示例16: PspGetNextThreadID

static DWORD PspGetNextThreadID(HANDLE ProcessHandle){	DWORD thread_id;ENTER_CRITICAL_SECTION();	thread_id = PsGetProcessPtr(ProcessHandle)->next_thread_id++;EXIT_CRITICAL_SECTION();	return thread_id;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:10,


示例17: PspThreadCutterThread

static DWORD PspThreadCutterThread(PVOID StartContext){	HANDLE ProcessHandle, ThreadHandle;	PTHREAD_CONTROL_BLOCK *pt_prev_thread, *pt_cur_thread;	while(1) {		/* check thread cutting list */		if(!PspPopCuttingItem(&m_ThreadCuttingList, &ThreadHandle)) {			HalTaskSwitch();			continue;		}ENTER_CRITICAL_SECTION();		ProcessHandle = PsGetThreadPtr(ThreadHandle)->parent_process_handle;		/* if requsted thread's parent process handle is same with system process handle, then do nothing!! protect system thread */		if(ProcessHandle == PsGetThreadPtr(PsGetCurrentThread())->parent_process_handle) {			goto $exit;		}		/* invalid thread */		if(PsGetProcessPtr(ProcessHandle)->thread_count == 0) {			goto $exit;		} 		/* check whether there is only one thread exist in the parent process */		else if(PsGetProcessPtr(ProcessHandle)->thread_count == 1) {			PsGetProcessPtr(ProcessHandle)->pt_head_thread = NULL;		}		/* more than 2 threads exist */		else {			pt_prev_thread = pt_cur_thread = &(PsGetProcessPtr(ProcessHandle)->pt_head_thread);			while(*pt_cur_thread != PsGetThreadPtr(ThreadHandle)) {				/* there is no requested thread in the parent process */				if((*pt_cur_thread)->pt_next_thread == NULL) {					goto $exit;				}				pt_prev_thread = pt_cur_thread;				pt_cur_thread = &((*pt_cur_thread)->pt_next_thread);			}			/* change next thread pointer */			(*pt_prev_thread)->pt_next_thread = (*pt_cur_thread)->pt_next_thread;		}		PsGetProcessPtr(ProcessHandle)->thread_count--;		/* except user mode program's stack */		if(PsGetThreadPtr(ThreadHandle)->pt_stack_base_address >= (int *)0x00200000)			MmFreeNonCachedMemory((PVOID)(PsGetThreadPtr(ThreadHandle)->pt_stack_base_address)); /* dealloc stack */		MmFreeNonCachedMemory((PVOID)(PsGetThreadPtr(ThreadHandle))); /* dealloc thread */$exit:EXIT_CRITICAL_SECTION();	}	return 0;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:55,


示例18: eMBASCIIStart

voideMBASCIIStart( void ){    ENTER_CRITICAL_SECTION(  );    vMBPortSerialEnable( TRUE, FALSE );    eRcvState = STATE_RX_IDLE;    EXIT_CRITICAL_SECTION(  );    /* No special startup required for ASCII. */    ( void )xMBPortEventPost( EV_READY );}
开发者ID:198401,项目名称:pid,代码行数:11,


示例19: trap_recover

static voidtrap_recover (void){  if (WITHIN_CRITICAL_SECTION_P ())    {      CLEAR_CRITICAL_SECTION_HOOK ();      EXIT_CRITICAL_SECTION ({});    }  reset_interruptable_extent ();  continue_from_trap (saved_signo, saved_info, saved_scp);}
开发者ID:barak,项目名称:mit-scheme,代码行数:11,


示例20: eMBMasterRTUStart

/************************************************************************* * eMBMasterRTUStart * Изначально приемник в состоянии STATE_M_RX_INIT. Запускаем таймер на t3.5 * Если символ не получен, то переводим приемник в STATE_M_RX_IDLE. * гарантировано пока не увидим начало фрейма(t3.5) не примем никакого мусора. *************************************************************************/voideMBMasterRTUStart( void ){    ENTER_CRITICAL_SECTION(  );    eRcvState = STATE_M_RX_INIT; //   vMBMasterPortSerialEnable( TRUE, FALSE );			// Режим приёма    vMBMasterPortTimersT35Enable(  );					// Старт таймера t3.5 символа    EXIT_CRITICAL_SECTION(  );}
开发者ID:bearxiong99,项目名称:SmI_IEC104,代码行数:17,


示例21: lds_uart_init

void lds_uart_init(void){	GPIO_InitTypeDef GPIO_InitStructure;	USART_InitTypeDef USART_InitStructure;	NVIC_InitTypeDef NVIC_InitStructure;	//	USART_ClockInitTypeDef USART_ClockInitStructure;	//	NVIC_InitTypeDef NVIC_InitStructure;	//======================时钟初始化=======================================	RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC, ENABLE);	RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);//	//======================IO初始化=======================================		//USART2_TX	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;	GPIO_Init(GPIOA, &GPIO_InitStructure);	//USART2_RX	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;	GPIO_Init(GPIOA, &GPIO_InitStructure);	//配置485发送和接收模式//    TODO   暂时先写B13 等之后组网测试时再修改	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;	GPIO_Init(GPIOC, &GPIO_InitStructure);	//======================串口初始化=======================================	USART_InitStructure.USART_BaudRate = 9600;	USART_InitStructure.USART_Parity = USART_Parity_No;	USART_InitStructure.USART_WordLength = USART_WordLength_8b;	USART_InitStructure.USART_StopBits = USART_StopBits_1;	USART_InitStructure.USART_HardwareFlowControl =			USART_HardwareFlowControl_None;	USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;		GPIO_SetBits(GPIOC ,GPIO_Pin_3);	ENTER_CRITICAL_SECTION(); //关全局中断	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);	NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;	NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;	NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;	NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;	NVIC_Init(&NVIC_InitStructure);	USART_Init(USART2, &USART_InitStructure);	USART_ITConfig(USART2, USART_IT_RXNE, ENABLE);	USART_Cmd(USART2, ENABLE);	EXIT_CRITICAL_SECTION(); //开全局中断	}
开发者ID:Triney,项目名称:code,代码行数:52,


示例22: PspProcessCutterThread

static DWORD PspProcessCutterThread(PVOID StartContext){	HANDLE ProcessHandle;	PPROCESS_CONTROL_BLOCK *pt_prev_process, *pt_cur_process;	PTHREAD_CONTROL_BLOCK  *pt_cur_thread;	while(1) {		/* check process cutting list */		if(!PspPopCuttingItem(&m_ProcessCuttingList, &ProcessHandle)) {			HalTaskSwitch();			continue;		}ENTER_CRITICAL_SECTION();		/* if requsted process handle is same with system process handle, then do nothing!! protect system process */		if(ProcessHandle == PsGetThreadPtr(PsGetCurrentThread())->parent_process_handle) {			goto $exit;		}		/* find requested process position in the process list */		pt_prev_process = pt_cur_process = &(m_ProcMgrBlk.pt_head_process);		while(*pt_cur_process != PsGetProcessPtr(ProcessHandle)) {			/* there is no requested process in the list */			if((*pt_cur_process)->pt_next_process == NULL) {				goto $exit;			}			pt_prev_process = pt_cur_process;			pt_cur_process = &((*pt_cur_process)->pt_next_process);		}		/* change next process pointer */		(*pt_prev_process)->pt_next_process = (*pt_cur_process)->pt_next_process;		m_ProcMgrBlk.process_count--;		/* dealloc all threads belonged to the requested process */		pt_cur_thread = &(PsGetProcessPtr(ProcessHandle)->pt_head_thread);		while(*pt_cur_thread != NULL) {			MmFreeNonCachedMemory((PVOID)((*pt_cur_thread)->pt_stack_base_address));			MmFreeNonCachedMemory((PVOID)(*pt_cur_thread));			pt_cur_thread = &((*pt_cur_thread)->pt_next_thread);		}		/* dealloc the requested process memory */		MmFreeNonCachedMemory((PVOID)ProcessHandle);$exit:EXIT_CRITICAL_SECTION();	}	return 0;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:51,


示例23: PspAddNewThread

static BOOL PspAddNewThread(HANDLE ProcessHandle, HANDLE ThreadHandle){	PTHREAD_CONTROL_BLOCK *pt_next_thread;ENTER_CRITICAL_SECTION();	pt_next_thread = &PsGetProcessPtr(ProcessHandle)->pt_head_thread;	while(*pt_next_thread)		pt_next_thread = &(*pt_next_thread)->pt_next_thread;	*pt_next_thread = PsGetThreadPtr(ThreadHandle);	PsGetProcessPtr(ProcessHandle)->thread_count++;EXIT_CRITICAL_SECTION();	return TRUE;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:14,


示例24: PspAddNewProcess

static BOOL PspAddNewProcess(HANDLE ProcessHandle){	PPROCESS_CONTROL_BLOCK *pt_next_process;ENTER_CRITICAL_SECTION();	pt_next_process = &m_ProcMgrBlk.pt_head_process;	while(*pt_next_process)		pt_next_process = &(*pt_next_process)->pt_next_process;	*pt_next_process = PsGetProcessPtr(ProcessHandle);	m_ProcMgrBlk.process_count++;EXIT_CRITICAL_SECTION();	return TRUE;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:14,


示例25: vMBPortEventClose

voidvMBPortEventClose(  ){    ENTER_CRITICAL_SECTION(  );    if( bIsInitialized )    {        if( 0 != arxEventHdls[0].xQueueHdl )        {            vQueueDelete( arxEventHdls[0].xQueueHdl );        }        HDL_RESET( &arxEventHdls[0] );    }    EXIT_CRITICAL_SECTION(  );}
开发者ID:WillJason,项目名称:cortex-M-Serise,代码行数:14,


示例26: SyspSetupSysCallgate

static BOOL SyspSetupSysCallgate(void){ENTER_CRITICAL_SECTION();	m_GdtTable[SYSCALL_GATE>>3].count		= 1;	m_GdtTable[SYSCALL_GATE>>3].type		= 0xec; /* 11101100 */	m_GdtTable[SYSCALL_GATE>>3].selector	= KERNEL_CS;	m_GdtTable[SYSCALL_GATE>>3].offset_1	= (BYTE) (((int)Sysp_SERVICE_CALL_MANAGER) & 0x000000ff);	m_GdtTable[SYSCALL_GATE>>3].offset_2	= (BYTE)((((int)Sysp_SERVICE_CALL_MANAGER) & 0x0000ff00) >> 8);	m_GdtTable[SYSCALL_GATE>>3].offset_3	= (BYTE)((((int)Sysp_SERVICE_CALL_MANAGER) & 0x00ff0000) >> 16);	m_GdtTable[SYSCALL_GATE>>3].offset_4	= (BYTE)((((int)Sysp_SERVICE_CALL_MANAGER) & 0xff000000) >> 24);EXIT_CRITICAL_SECTION();	return TRUE;}
开发者ID:na94ojt,项目名称:MyPlayground,代码行数:14,


示例27: ReadSingleReg

// *************************************************************************************************// @fn          ReadSingleReg// @brief       Read byte from register.// @param       none// @return      none// *************************************************************************************************unsigned char ReadSingleReg(unsigned char addr){   unsigned char x;   u16 int_state;   ENTER_CRITICAL_SECTION(int_state);   RF1AINSTR1B = (addr | RF_REGRD);   x = RF1ADOUT1B;   EXIT_CRITICAL_SECTION(int_state);   return x;}
开发者ID:alkin,项目名称:tidecc,代码行数:20,


示例28: GetPoolStats

/**************************************************************************************************** * @fn      GetPoolStats *          Returns the total block count and used blocks count from the given pool * * @param   [IN]pPool - Pointer to the memory pool that has been initialized * @param   [OUT]pTotalCount - return the total number of blocks in the given pool * @param   [OUT]pUsedCount - return the current used block count * * @return  none * ***************************************************************************************************/void GetPoolStats( void *pPool, uint32_t *pTotalCount, uint32_t *pUsedCount ){    SETUP_CRITICAL_SECTION();    ENTER_CRITICAL_SECTION();    if (pTotalCount)    {        *pTotalCount = ((BlkMem_t*)pPool)->TotalCnt;    }    if (pUsedCount)    {        *pUsedCount = ((BlkMem_t*)pPool)->UsedCnt;    }    EXIT_CRITICAL_SECTION();}
开发者ID:hongyunnchen,项目名称:open-sensor-platform,代码行数:25,


示例29: eMBRTUInit

/** ----------------------------------------------------------------------------------------------------------------------- eMBRTUInit -----------------------------------------------------------------------------------------------------------------------*   Event Handler for GPI module** 	@date       			DEC/02/2013* 	@author                         FW_DEV_2* 	@pre                            None* 	@return	 			None*************************************************************************************************************************/eMBErrorCode eMBRTUInit( UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity ){    eMBErrorCode    eStatus = MB_ENOERR;    ULONG           usTimer1_5=0;    ULONG 			usTimer3_5=0;    printf("Initializing RTU/n");    ( void )ucSlaveAddress;    ENTER_CRITICAL_SECTION(  );    /* Modbus RTU uses 8 Databits. */    if( xMBPortSerialInit( ucPort, ulBaudRate, 8, eParity ) != TRUE )    {        printf("Serial port initialization failed/n");    	eStatus = MB_EPORTERR;    }    else    {        /* If baudrate > 19200 then we should use the fixed timer values         * t35 = 1750us. Otherwise t35 must be 3.5 times the character time.         */        if( ulBaudRate > 19200 )        {        	usTimer1_5 = 75000;       	/* 750 us */            usTimer3_5 = 175000;		/* 1.750 ms*/        }        else        {            /* The timer reload value for a character is given by:             *             * ChTimeValue = Ticks_per_1s / ( Baudrate / 11 )             *             = 11 * Ticks_per_1s / Baudrate             *             = 220000 / Baudrate             * The reload for t3.5 is 1.5 times this value and similary             * for t3.5.             */        	usTimer1_5 = (1500000/ulBaudRate); 		//        	usTimer3_5 = (3500000/ulBaudRate);        }        printf("Initialize timer");        if( xMBPortTimersInit( ( USHORT ) usTimer3_5 ) != TRUE )        {            eStatus = MB_EPORTERR;        }    }    EXIT_CRITICAL_SECTION(  );    return eStatus;}
开发者ID:ankit4970,项目名称:modbus_lpc1769,代码行数:62,


示例30: eMBRTUStart

voideMBRTUStart( void ){    ENTER_CRITICAL_SECTION(  );    /* Initially the receiver is in the state STATE_RX_INIT. we start     * the timer and if no character is received within t3.5 we change     * to STATE_RX_IDLE. This makes sure that we delay startup of the     * modbus protocol stack until the bus is free.     */    eRcvState = STATE_RX_INIT;    vMBPortSerialEnable( TRUE, FALSE );    vMBPortTimersEnable(  );    EXIT_CRITICAL_SECTION(  );}
开发者ID:alkyl1978,项目名称:stelariz,代码行数:15,



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


C++ EXPECT函数代码示例
C++ EXIT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。