本例是把插槽连接到信号并调用信号的基本例子。
This example is a basic example of connecting a slot to a signal and then invoking the signal.
然后使用值18 (SIGCHLD)来调用信号处理程序,确认子进程的退出,并且父进程返回到sleep (60)。
The signal handler is called with a value of 18 (SIGCHLD), the child's exit is acknowledged, and the parent goes back to its sleep (60).
调用这个方法来等待所需要信号上某个事件的完成,等待指定的一段时间。
This method is called to wait for an event completion on the indicated semaphore, with a specified time.
对事件对象调用的等待函数会阻塞调用线程,直到其状态被设置为有信号状态为止。
The wait function on the event object blocks the calling thread until its state is set to signaled state.
然后主循环查询自己的信号和处理程序之间的内部映射表,也叫做回调,并调用注册到指定对象的指定信号的处理程序。
The main loop then looks through its internal mapping table between its signals and handlers, also called callbacks, and calls the handlers registered for the given signal on the given object.
这将导致第三个问题:为信号处理程序接收信号的程序调用已包装的调用。
This led to a third problem: Programs that take signals for which the signal handlers invoke wrapped calls.
在本例中,控制器会将FAILURE信号发送给协调器,从而以反转顺序调用补偿活动。
In this case the controller sends out a FAILURE signal to the coordinator, thus invoking the compensatory activities in reverse order.
如果控制器收到了来自活动的SUCCESS信号,它会发送信号到协调器组件(在本例中是PROPAGATE),从而调用下一个活动。
If the controller receives a SUCCESS signal from an activity, it sends a signal to the coordinator component (in this case PROPAGATE), thus invoking the next activity.
或者,调用了正在处理全局数据结构的某个函数,而在信号处理器中又调用了同一个函数。
Or, you call some function that was in the middle of the manipulation of the global data structure and you call the same function from the signal handler.
如果调用线程并不拥有这个互斥信号量,那么这个函数的执行将会失败。
If the calling thread has no ownership of this mutex, this function fails.
f跟踪通过fork或vfork创建的所有子进程,跟踪输出中包括它们的信号、错误和系统调用。
F follows all children created by fork or vfork and includes their signals, faults, and system calls in the trace output.
如果当进程正在使用malloc在它的堆上分配额外的内存时,您通过信号处理器调用 malloc,那会怎样?
What if the process was in the middle of allocating additional memory on its heap using malloc, and you call malloc from the signal handler?
相反,服务器可以通过调用Work对象的release方法,给资源适配器发信号。
Instead, the server can signal to the resource adapter by calling the release method on the Work object.
Linux使用pthread_condition_init调用在当前进程内创建信号对象,在其中维持一个在零与最大值之间的计数值。
Linux USES the pthread_condition_init call to create a semaphore object within the current process that maintains a count between zero and a maximum value.
truss生成跟踪信息,包括进程执行的系统调用、它收到的信号和它导致的机器错误。
The command truss produces a trace of the system calls it performs, the signals it receives, and the machine faults it incurs.
此时write系统调用会被进程接收到的SIGBUS信号中断,因为当前进程访问了非法内存地址。
Your write system call will be interrupted by the bus error signal SIGBUS, because you performed a bad memory access.
每当进程接收到某个已处理的信号时,就会调用通过sigset分配的函数。
Whenever a handled signal is received by a process, the function assigned through sigset is called.
函数调用sigsuspend通过重置信号掩码并使进程休眠一个单一的原子操作来解决这一问题。
The function call sigsuspend resolves this problem by resetting the signal mask and putting the process to sleep in a single atomic operation.
在第 2种情况中,我们使用了Linux 中的strace实用程序,它能够跟踪系统调用和信号,从而找出程序发生错误的地方。
Scenario 2 uses the strace utility in Linux that enables the tracing of system calls and signals to identify where a program is failing.
要等待某个事件,则可以使用 semop()函数,并将 sem_op 的值设置为-1,这样就可以阻塞调用进程,直到它变为有信号状态为止。
To wait on an event, semop() function is used with sem_op value as -1 thus blocking the calling process until it is signaled.
如果您不想调用原始方法,那么可以从插槽disconnect信号,例如通过在logger . show行之前添加以下行。
If you don't want the original method to be called, you can disconnect the signal from the slot, for instance by adding the following line before the logger.show line.
对于SIGCHLD信号,应用程序必须调用wait (3c)函数,以等待子进程退出。
For the SIGCHLD signal, the application must call the wait (3c) function to wait for the child process to exit.
l利用事件——当异步调用完成时设定的信号。
Using events - a signal is set as soon as the asynchronous call is finished.
在Linux中,可以调用相同的semget来打开某个信号量,不过此时semflg的值为0:int semget (key,nsems, 0)。
In Linux, the same semget call is used to open the semaphore with 0 as the value for the semflg: int semget (key, nsems, 0). In this code.
当选中该选项时,delegate调用CDI目标并使用与所选信号相对应的IC DISignal恢复执行。
When this option is selected, the delegate calls on the CDI target to resume its execution with the ICDISignal corresponding to the selected signal.
假定信号在close系统调用设置errno变量到其返回之前这一极小的时间片段内生成。
Suppose a signal is generated during the very small time gap between setting the errno variable by the close system call and its return.
那是因为只有一些系统调用可以安全地调用内部信号:只有可重入的(re -entrant)或者不被信号中断的调用才可以被安全地调用。
That's because only a few system calls can be safely called inside signals. Only calls that are re-entrant or not interruptible by signals can be called safely.
那是因为只有一些系统调用可以安全地调用内部信号:只有可重入的(re -entrant)或者不被信号中断的调用才可以被安全地调用。
That's because only a few system calls can be safely called inside signals. Only calls that are re-entrant or not interruptible by signals can be called safely.
应用推荐