本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
}
}
}
示例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;
}
示例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; //正确接收到一个字节数据
}
示例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;
}
示例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;
}
示例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;
}
}
}
}
示例10: original_getinfo
void original_getinfo()
{
passnumber=1;
send_signal();
sleep(3);
passnumber=0;
}
示例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);
}
示例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);
}
示例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");
}
示例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);
}
示例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;
}