本文整理汇总了C++中send_signal函数的典型用法代码示例。如果您正苦于以下问题:C++ send_signal函数的具体用法?C++ send_signal怎么用?C++ send_signal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_signal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: write_pipe
uint32_t write_pipe(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) {
assert(node->device != 0 && "Attempted to write to a fully-closed pipe.");
/* Retreive the pipe object associated with this file node */
pipe_device_t * pipe = (pipe_device_t *)node->device;
#if DEBUG_PIPES
if (pipe->size > 300) { /* Ignore small pipes (ie, keyboard) */
debug_print(INFO, "[debug] Call to write to pipe 0x%x", node->device);
debug_print(INFO, " Available space: %d", pipe_available(pipe));
debug_print(INFO, " Total size: %d", pipe->size);
debug_print(INFO, " Request size: %d", size);
debug_print(INFO, " Write pointer: %d", pipe->write_ptr);
debug_print(INFO, " Read pointer: %d", pipe->read_ptr);
debug_print(INFO, " Buffer address: 0x%x", pipe->buffer);
debug_print(INFO, " Write: %s", buffer);
}
#endif
if (pipe->dead) {
debug_print(WARNING, "Pipe is dead?");
send_signal(getpid(), SIGPIPE);
return 0;
}
size_t written = 0;
while (written < size) {
spin_lock(pipe->lock_write);
#if 0
size_t available = 0;
if (pipe->read_ptr <= pipe->write_ptr) {
available = pipe->size - pipe->write_ptr;
} else {
available = pipe->read_ptr - pipe->write_ptr - 1;
}
if (available) {
available = min(available, size - written);
memcpy(&pipe->buffer[pipe->write_ptr], buffer, available);
pipe_increment_write_by(pipe, available);
written += available;
}
#else
while (pipe_available(pipe) > 0 && written < size) {
pipe->buffer[pipe->write_ptr] = buffer[written];
pipe_increment_write(pipe);
written++;
}
#endif
spin_unlock(pipe->lock_write);
wakeup_queue(pipe->wait_queue_readers);
pipe_alert_waiters(pipe);
if (written < size) {
sleep_on(pipe->wait_queue_writers);
}
}
return written;
}
开发者ID:klange,项目名称:ponyos,代码行数:60,代码来源:pipe.c
示例17: unifi_send_signal
/*
* ---------------------------------------------------------------------------
* unifi_send_signal
*
* Invokes send_signal() to queue a signal in the command or traffic queue
* If sigptr pointer is NULL, it pokes the bh to check if UniFi is responsive.
*
* Arguments:
* card Pointer to card context struct
* sigptr Pointer to signal from card.
* siglen Size of the signal
* bulkdata Pointer to the bulk data of the signal
*
* Returns:
* CSR_RESULT_SUCCESS on success
* CSR_WIFI_HIP_RESULT_NO_SPACE if there were insufficient data slots or no free signal queue entry
*
* Notes:
* unifi_send_signal() is used to queue signals, created by the driver,
* to the device. Signals are constructed using the UniFi packed structures.
* ---------------------------------------------------------------------------
*/
CsrResult unifi_send_signal(card_t *card, const CsrUint8 *sigptr, CsrUint32 siglen,
const bulk_data_param_t *bulkdata)
{
q_t *sig_soft_q;
CsrUint16 signal_id;
CsrResult r;
CsrUint32 run_bh;
CsrUint32 priority_q;
/* A NULL signal pointer is a request to check if UniFi is responsive */
if (sigptr == NULL)
{
card->bh_reason_host = 1;
return unifi_run_bh(card->ospriv);
}
priority_q = 0;
run_bh = 1;
signal_id = GET_SIGNAL_ID(sigptr);
/*
* If the signal is a CSR_MA_PACKET_REQUEST ,
* we send it using the traffic soft queue. Else we use the command soft queue.
*/
if (signal_id == CSR_MA_PACKET_REQUEST_ID)
{
CsrUint16 frame_priority;
if (card->periodic_wake_mode == UNIFI_PERIODIC_WAKE_HOST_ENABLED)
{
run_bh = 0;
}
#if defined (CSR_WIFI_HIP_DEBUG_OFFLINE) && defined (CSR_WIFI_HIP_DATA_PLANE_PROFILE)
unifi_debug_log_to_buf("D");
#endif
/* Sanity check: MA-PACKET.req must have a valid bulk data */
if ((bulkdata->d[0].data_length == 0) || (bulkdata->d[0].os_data_ptr == NULL))
{
unifi_error(card->ospriv, "MA-PACKET.req with empty bulk data (%d bytes in %p)\n",
bulkdata->d[0].data_length, bulkdata->d[0].os_data_ptr);
dump((void *)sigptr, siglen);
return CSR_RESULT_FAILURE;
}
/* Map the frame priority to a traffic queue index. */
frame_priority = GET_PACKED_MA_PACKET_REQUEST_FRAME_PRIORITY(sigptr);
priority_q = unifi_frame_priority_to_queue((CSR_PRIORITY)frame_priority);
sig_soft_q = &card->fh_traffic_queue[priority_q];
}
else
{
sig_soft_q = &card->fh_command_queue;
}
r = send_signal(card, sigptr, siglen, bulkdata, sig_soft_q, priority_q, run_bh);
/* On error, the caller must free or requeue bulkdata buffers */
return r;
} /* unifi_send_signal() */
开发者ID:Grommerin,项目名称:meta-marsboard-bsp,代码行数:82,代码来源:csr_wifi_hip_send.c
示例18: parent_loop
void parent_loop() {
// Wait to get instruction from controller
dump("Waiting for instruction from controller");
int monitor_fifo_fd = open(monitor_fifo_name, O_RDONLY);
if (-1 == monitor_fifo_fd) {
unlink(monitor_fifo_name);
if (EINTR != errno) {
dump("Failed to open monitor fifo with error: %d", errno);
}
return;
}
// Read the response
fifo_data fdata;
if (-1 == read(monitor_fifo_fd, &fdata, sizeof(fdata))) {
unlink(monitor_fifo_name);
if (EINTR != errno) {
dump("Failed to read monitor fifo with error: %d", errno);
}
return;
}
// Check if we got the go ahead
switch(fdata.request_type) {
case STOP:
dump("Received stop command from controller");
send_signal(SIGTERM, true);
return;
default:
dump("Invalid response received from controller");
return;
}
}
开发者ID:elanteigne,项目名称:school-assignments,代码行数:33,代码来源:monitor.c
示例19: input_break
/* This is called by the lower half when a break is received. */
void
input_break ()
{
struct queue **qp = termstate.c_lflag & ICANON ? &rawq : &inputq;
/* Don't do anything if IGNBRK is set. */
if (termstate.c_iflag & IGNBRK)
return;
/* If BRKINT is set, then flush queues and send SIGINT. */
if (termstate.c_iflag & BRKINT)
{
drop_output ();
/* XXX drop pending input How?? */
send_signal (SIGINT);
return;
}
/* A break is then read as a null byte; marked specially if PARMRK is set. */
if (termstate.c_iflag & PARMRK)
{
enqueue_quote (qp, CHAR_USER_QUOTE);
enqueue_quote (qp, '\0');
}
enqueue_quote (qp, '\0');
}
开发者ID:GNUHurdTR,项目名称:hurd,代码行数:27,代码来源:munge.c
示例20: main
int main (void) {
// enable pull up resistors
bset(PORTB, 1);
bset(PORTB, 2);
bset(PORTB, 3);
// burn some time to let inputs settle
__builtin_avr_delay_cycles(20);
// this is a really inefficent way to do it, but i had the I/Os
// and a free 4 position switch, so why not. simpler than binary input.
// to read, all pull ups are enabled, and each pin of the switch
// is connected to a seperate IO. the IO that is low is switch pos
uint16_t delay = 60; // assume position 1 by default
// could use uint8_t and save some code space
// divide each delay by 4, then then delay for 4000ms in the loop
if (!bisset(PINB,3)) // position 2
delay = 120;
if (!bisset(PINB,1)) // position 3
delay = 180;
if (!bisset(PINB,2)) // position 4
delay = 300;
PORTB = 0; // disable pull ups
// enable output
bset(DDRB, 0);
while(true) {
send_signal(); // begin bulb exposure
// this is wasteful of power, but i tried using the wdt
// to let me sleep 1s in power down state, and it turns
// out that the wdt oscilator is way off. better to busy
// wait and be about correct than way out in left field
for(uint16_t i = 0; i <= delay; i++)
_delay_ms(1000);
send_signal(); // terminate bulb exposure
_delay_ms(10000); // wait for camera to recover its wits
}
}
开发者ID:ZigZagJoe,项目名称:BarnDoor,代码行数:47,代码来源:remote.cpp
注:本文中的send_signal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论