diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-6CF8A41B-C2DD-5D57-A71D-6405CE08A06B.dita --- a/Symbian3/PDK/Source/GUID-6CF8A41B-C2DD-5D57-A71D-6405CE08A06B.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-6CF8A41B-C2DD-5D57-A71D-6405CE08A06B.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,36 +1,36 @@ - - - - - -Using Signals to Handle Asynchronous Events

You can use signals to handle asynchronous user events. A process (program code) can send a signal to itself that can be handled asynchronously based on the signal handler registered for it. This provides a way to perform tasks in parallel without any complex thread manipulation in the program code.

The following example code demonstrates how a program code sets a signal to itself and how it handles the signal asynchronously in a signal handler:

#include <signal.h> -#include <stdio.h> -void sighandler(int signum) - { - if(signum == SIGUSR1) - { - // Code to perform custom handling - } - else if(signum == SIGUSR2) - { - // Code to perform custom handling - } - } -int main() - { - signal(SIGUSR1,sighandler); - signal(SIGUSR2,sighandler); - // program logic - raise(SIGUSR1); // indicates user event one - // program logic - raise(SIGUSR2); // indicates user event two - // program logic - return 0; - }
Signal Emulation on Symbian + + + + + +Using Signals to Handle Asynchronous Events

You can use signals to handle asynchronous user events. A process (program code) can send a signal to itself that can be handled asynchronously based on the signal handler registered for it. This provides a way to perform tasks in parallel without any complex thread manipulation in the program code.

The following example code demonstrates how a program code sets a signal to itself and how it handles the signal asynchronously in a signal handler:

#include <signal.h> +#include <stdio.h> +void sighandler(int signum) + { + if(signum == SIGUSR1) + { + // Code to perform custom handling + } + else if(signum == SIGUSR2) + { + // Code to perform custom handling + } + } +int main() + { + signal(SIGUSR1,sighandler); + signal(SIGUSR2,sighandler); + // program logic + raise(SIGUSR1); // indicates user event one + // program logic + raise(SIGUSR2); // indicates user event two + // program logic + return 0; + }
Signal Emulation on Symbian Platform Using Signals to Terminate Processes Using Signals to Handle Exceptions
\ No newline at end of file