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


C++ send_signal函数代码示例

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


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

示例1: mu_signal_process

void mu_signal_process(char *command, int signal)
{
	boolean_t	pid_present, name_present;
	int4		pid, length, status, item, outv;
	char		prc_nam[20];
	unsigned short	name_len;
	$DESCRIPTOR(d_prc_nam,"");

	memset(prc_nam, 0, SIZEOF(prc_nam));
	pid_present = name_present = FALSE;
	if (cli_present("id") == CLI_PRESENT)
	{
		if(!cli_get_hex("id", &pid))
			return;
		pid_present = TRUE;
	}
	if (cli_present("name") == CLI_PRESENT)
	{
		name_len = 20;
		if (!cli_get_str("name", prc_nam, &name_len))
			return;
		if (prc_nam[name_len-1] == '"')
			name_len--;
		if (prc_nam[0] == '"')
		{
			d_prc_nam.dsc$a_pointer = &prc_nam[1];
			name_len--;
		} else
			d_prc_nam.dsc$a_pointer = &prc_nam;
		d_prc_nam.dsc$w_length = name_len;
		name_present = TRUE;
	}
	if (!name_present)
	{
		if (SS$_NORMAL == send_signal(pid, signal))
			SENDMSG_OUTPUT("", pid);
		return;
	}
	item = JPI$_PID;
	status = lib$getjpi(&item, 0, &d_prc_nam, &outv, 0, 0);
	if (SS$_NORMAL != status)
	{
		rts_error(VARLSTCNT(1) status);
		return;
	}
	if (!pid_present)
	{
		if (SS$_NORMAL == send_signal(outv, signal))
			SENDMSG_OUTPUT(&prc_nam, outv);
		return;
	}
	if (outv != pid)
	{
		util_out_print("ID !XL and NAME !AD are not the same process", FLUSH, pid, LEN_AND_STR(&prc_nam));
		return;
	}
	if (SS$_NORMAL == send_signal(pid, signal))
		SENDMSG_OUTPUT(&prc_nam, pid);
	return;
}
开发者ID:ChristopherEdwards,项目名称:fis-gtm,代码行数:60,代码来源:mu_signal_process.c

示例2: send_signals

void send_signals() {
    printf("Sending %d SIGRTMIN signals to catcher...\n", signal_num);
    for (int i = 0; i < signal_num; i++)
        send_signal(catcher_pid, SIGRTMIN);
    printf("Sending SIGRTMIN+1 to catcher...\n");
    send_signal(catcher_pid, SIGRTMIN + 1);
}
开发者ID:michalborzecki,项目名称:sysopy4,代码行数:7,代码来源:sender.c

示例3: send_signals

void send_signals(int signal_num, pid_t sender_pid) {
    sigusr1_received = 0;
    for (int i = 0; i < signal_num; i++) {
        send_signal(sender_pid, SIGUSR1);
        while (!sigusr1_received);
        sigusr1_received = 0;
    }
    send_signal(sender_pid, SIGUSR2);
}
开发者ID:michalborzecki,项目名称:sysopy4,代码行数:9,代码来源:catcher.c

示例4: pacemaker_avi

void pacemaker_avi(void const *i) {
    volatile static int state = IdleAVI;
    while(1) {
        switch(state) {
        case IdleAVI: {
            ////////pc.printf("\nIdleAVI");
            osEvent evt = Thread::signal_wait(0);
            Thread::wait(1);
            if(evt.value.signals & Apace || evt.value.signals & Asense) {
                //////////pc.printf("\nAP/AS");
                x_clock.reset();
                state = AVI;
            }
            break;
        }
        case AVI: {
            osEvent evt;
            evt = Thread::signal_wait(Vsense, t_avi - x_clock.read_ms());
            Thread::wait(1);
            if(evt.value.signals & Vsense) {
                state = IdleAVI;
            }
            else if(x_clock.read_ms() >= t_avi && clk_clock.read_ms() >= t_uri) {
                pc.printf("\nAVI Vpace%i:", test_clock.read_ms());
                send_signal(Vpace);
                state = IdleAVI;
            }
            else if(x_clock.read_ms() >= t_avi && clk_clock.read_ms() < t_uri) {
                state = WaitURI;
            }
            break;
        }
        case WaitURI: {
            ////////pc.printf("\nWaitURI");
            osEvent evt = Thread::signal_wait(Vsense, t_uri - clk_clock.read_ms() );
            Thread::wait(1);
            if(evt.value.signals & Vsense) {
                state = IdleAVI;
            }
            else if(clk_clock.read_ms() >= t_uri  ) {
                send_signal(Vpace);
                pc.printf("\nAVI Vpace%i:", test_clock.read_ms());
                state = IdleAVI;
            }
            break;

        }
        default: {
            state = IdleAVI;
        }

        }
    }

}
开发者ID:SeverinVisionary,项目名称:CIS-541,代码行数:55,代码来源:main.cpp

示例5: main

int main(int argc, char *argv[])
{
    int client_flag, server_cmd;

    if (!connect_server())
    {
        qDebug() << "Not connected control server!";
        return 1;
    }
    else
    {
        qDebug() << "Connected to control server!";
    }
    if (!connect_psdb())
    {
        qDebug() << "Not connected parameter server database!";
        return 1;
    }
    else
    {
        qDebug() << "Connected to parameter server database!";
    }
    while (1)
    {
        server_cmd = request_cmd();
        switch (server_cmd)
        {
            case cmd_work:

                client_flag = execute_evo_motor();
                break;
            case cmd_term:
                qDebug() << "cmd_exit";
                break;
            default:
                qDebug() << "error exit";
                break;
        }
        switch (client_flag)
        {
            case flag_success:
                send_signal(flag_success);
                break;
            case flag_failure:
            default:
                qDebug() << "flag_failure";
                send_signal(flag_failure);
                break;
        }
    }
    return 0;
}
开发者ID:whhxp,项目名称:optimal_design,代码行数:52,代码来源:main.cpp

示例6: i2c_ReadByte

uint8 i2c_ReadByte(uint8 SlaveAddress,uint8 AccessAddress,uint8 *Data)
{
    I2C0_C1     |= 0x10;           //TX = 1,MCU设置为发送模式
    send_signal('S');               //发送开始信号 
    I2C0_D  = SlaveAddress & 0xfe;   //发送设备地址,并通知从机接收数据
           
    if(i2c_wait('T'))                  //等待一个字节数据传送完成  
    {      
        return 1;                         //没有传送成功,读一个字节失败   
    }
    if (i2c_wait('A'))                 //等待从机应答信号 
    {
        return 1;                         //没有等到应答信号,读一个字节失败 
    }
    I2C0_D  = AccessAddress;        //发送访问地址    
    if (i2c_wait('T'))                //等待一个字节数据传送完成 
    {
        return 1;                        //没有传送成功,读一个字节失败
    }
    if (i2c_wait('A'))                //等待从机应答信号   
    { 
        return 1;                        //没有等到应答信号,读一个字节失败  
    }
    
    pause();
    I2C0_C1 |= 0x04;//当MCU在主机模 式下,向该位写1将产生一个重新开始信号  
    I2C0_D = SlaveAddress | 0x01; //通知从机改为发送数据    
    if (i2c_wait('T'))               //等待一个字节数据传送完成  
    {
        return 1;                       //没有传送成功,读一个字节失败 
    }
    if (i2c_wait('A'))               //等待从机应答信号  
    {
        return 1;                      //没有等到应答信号,读一个字节失败
    }
    I2C0_C1 &= 0xef;           //TX = 0,MCU设置为接收模式    
    *Data = I2C0_D;            //读出IIC1D,准备接收数据   
    if (i2c_wait('T'))              //等待一个字节数据传送完成  
    {  
        return 1;                      //没有传送成功,读一个字节失败  
    }
    send_signal('O');           //发送停止信号    
    *Data = I2C0_D;            //读出接收到的一个数据    
          
    pause();
    
    return 0;                          //正确接收到一个字节数据 
}
开发者ID:MorS25,项目名称:amcfc,代码行数:48,代码来源:i2c.c

示例7: ep_ready

static void ep_ready(int txid, int status) {

    struct transaction_data *data = NULL;

    if (txid == 0)
        return;

    /* find the correct transaction data structure */
    data = ep_get_transaction(txid);

    if (data) {
#if 0
        printf("libep: decreasing data '%p' reference count from '%u' to '%u'\n",
                data, data->refcount, data->refcount - 1);
#endif
        data->refcount--;
        if ((data->refcount == 0 && data->ready) || !status) {
            /* all callbacks have returned true or one has failed */
            send_signal(txid, status);
            ep_list_remove(&transaction_list, data);
            free(data);
            data = NULL;
        }
    }

    return;
}
开发者ID:arcean,项目名称:ohm-plugins-misc,代码行数:27,代码来源:ep.c

示例8: sock_send_signal

int
sock_send_signal(int purpose,int  sig)
{
  if (accept_if_needed(purpose) != -1)
    return send_signal(purpose_table[purpose], sig);
  return -1;
}
开发者ID:oldk1331,项目名称:fricas,代码行数:7,代码来源:sockio-c.c

示例9: pacemaker_vrp

void pacemaker_vrp(void const *i) {
    volatile static int state = IdleVRP;
    while(1) {
        switch(state) {
        case IdleVRP: {
            //pc.printf("\nIdleVRP%i",test_clock.read_ms());
            osEvent evt = Thread::signal_wait(0);
            Thread::wait(1);
            if(evt.value.signals & Vsignal) {
                pc.printf("\n Vsignal Rec");
                send_signal(Vsense);
                x_clock.reset();
                state = VRP;
            }
            else if(evt.value.signals & Vpace) {
                x_clock.reset();
                state = VRP;
            }
            break;
        }
        case VRP: {
            if( x_clock.read_ms() < t_vrp) {
                Thread::wait(t_vrp - x_clock.read_ms());
            }
            else if( x_clock.read_ms() >= t_vrp) {
                state = IdleVRP;
            }
            break;
        }
        default: {
            state = IdleVRP;
        }
        }
    }
}
开发者ID:SeverinVisionary,项目名称:CIS-541,代码行数:35,代码来源:main.cpp

示例10: original_getinfo

void original_getinfo()
{
    passnumber=1;
    send_signal();
    sleep(3);
    passnumber=0;
}
开发者ID:Daemonceltics,项目名称:Raspberry-Pi,代码行数:7,代码来源:iphone.c

示例11: ps7500_update_intr

static void
ps7500_update_intr (void *mach)
{
	struct machine_config *mc = (struct machine_config *) mach;
	void *state = (void *) mc->state;

#if 0
        state->NfiqSig = (io.fiq[FIQ] & io.fiqmask[FIQ]) ? LOW : HIGH;

        state->NirqSig =
                ((io.irq[IRQA] & io.irqmask[IRQA]) ||
                 (io.irq[IRQB] & io.irqmask[IRQB]) ||
                 (io.irq[IRQC] & io.irqmask[IRQC]) ||
                 (io.irq[IRQD] & io.irqmask[IRQD]) ||
                 (io.irq[IRQDMA] & io.irqmask[IRQDMA])) ? LOW : HIGH;
#endif
	interrupt_signal_t interrupt_signal;
	interrupt_signal.arm_signal.reset = Prev_level;
	interrupt_signal.arm_signal.firq = (io.fiq[FIQ] & io.fiqmask[FIQ]) ? Low_level : High_level;
	interrupt_signal.arm_signal.irq =
		((io.irq[IRQA] & io.irqmask[IRQA]) ||
                 (io.irq[IRQB] & io.irqmask[IRQB]) ||
                 (io.irq[IRQC] & io.irqmask[IRQC]) ||
                 (io.irq[IRQD] & io.irqmask[IRQD]) ||
                 (io.irq[IRQDMA] & io.irqmask[IRQDMA])) ? Low_level : High_level;
	send_signal(&interrupt_signal);

}
开发者ID:cherry-wb,项目名称:skyeye,代码行数:28,代码来源:skyeye_mach_ps7500.c

示例12: ps7500_update_int

static void ps7500_update_int(void *state)
{
	int i;

	//if (io.irq[IRQB] & io.net_int[IRQB]) {
	//	printf("Network interrupt set\n");
	//	for (i=0; i < 5; i++) {
	//		printf("IRQ[%d] %02x IRQMASK[%d] %02x\n",
	//			i, io.irq[i], i, io.irqmask[i]);
	//	}
	//}
#if 0
	state->NfiqSig = (io.fiq[FIQ] & io.fiqmask[FIQ]) ? LOW : HIGH;

	state->NirqSig =
		((io.irq[IRQA] & io.irqmask[IRQA]) ||
		 (io.irq[IRQB] & io.irqmask[IRQB]) ||
		 (io.irq[IRQC] & io.irqmask[IRQC]) ||
		 (io.irq[IRQD] & io.irqmask[IRQD]) ||
		 (io.irq[IRQDMA] & io.irqmask[IRQDMA])) ? LOW : HIGH;
#endif

	interrupt_signal_t interrupt_signal;
	interrupt_signal.arm_signal.reset = Prev_level;
	interrupt_signal.arm_signal.firq = (io.fiq[FIQ] & io.fiqmask[FIQ]) ? Low_level : High_level;
	interrupt_signal.arm_signal.irq =
		((io.irq[IRQA] & io.irqmask[IRQA]) ||
		 (io.irq[IRQB] & io.irqmask[IRQB]) ||
		 (io.irq[IRQC] & io.irqmask[IRQC]) ||
		 (io.irq[IRQD] & io.irqmask[IRQD]) ||
                 (io.irq[IRQDMA] & io.irqmask[IRQDMA])) ? Low_level : High_level;
	send_signal(&interrupt_signal);
}
开发者ID:cherry-wb,项目名称:skyeye,代码行数:33,代码来源:skyeye_mach_ps7500.c

示例13: child_main

void child_main() {
	// Ignore control-C in child
	setup_signal_handling(SIGINT, SIG_IGN);

	// Create the message queue
	msg_queue_id = msgget(MESSAGE_QUEUE_KEY, 0666 | IPC_CREAT);
	
	if (msg_queue_id == -1) {
		// Invalid message queue
		dump("Failed to open/create controller queue.");
		send_signal(SIGTERM, true);
		return;
	}
	
	while(running) {
		child_loop();
	}
	
	// Delete the message queue
	dump("Removing message queue");
	if (-1 == msgctl(msg_queue_id, IPC_RMID, 0)) {
		dump("Failed to delete message queue");
	}
	
	dump("Finished");
}
开发者ID:elanteigne,项目名称:school-assignments,代码行数:26,代码来源:controller.c

示例14: omap5912_update_int

static void
omap5912_update_int (void *state)
{
	//uart1 and os timer int is mapped to l2 int
        uint32_t requests;

	//printf("irq sig initial: %x\n", state->NirqSig);
	omap5912_update_l2_int(state);

	//printf(" here test  mpu1_itr data = %x\n", omap5912_io.ic.mpu_l1_itr);
	requests = omap5912_io.ic.mpu_l1_itr & ((~omap5912_io.ic.mpu_l1_mir) & 0xffffffff);
	//printf("requests %x\n",requests);
#if 0
	state->NirqSig = (requests) ? LOW : HIGH;
	state->NfiqSig = HIGH;
#endif
	interrupt_signal_t interrupt_signal;
	interrupt_signal.arm_signal.firq = High_level;
	interrupt_signal.arm_signal.reset = Prev_level;
	interrupt_signal.arm_signal.irq = (requests) ? Low_level : High_level;
	send_signal(&interrupt_signal);

	//printf("irq sig in l1:%x\n", state->NirqSig);

}
开发者ID:cherry-wb,项目名称:skyeye,代码行数:25,代码来源:skyeye_mach_omap5912.c

示例15: sys_raise

void sys_raise(struct cpu_state **cpu)
{
    unsigned int sig = (*cpu)->CPU_ARG1;

    send_signal(current_thread->process, sig);
    (*cpu)->CPU_ARG0 = 0;
}
开发者ID:infinitycoding,项目名称:universe,代码行数:7,代码来源:signal.c


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