author | Graeme Price <GRAEME.PRICE@NOKIA.COM> |
Fri, 15 Oct 2010 14:32:18 +0100 | |
changeset 15 | 307f4279f433 |
parent 13 | 48780e181b38 |
permissions | -rw-r--r-- |
13
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
1 |
<?xml version="1.0" encoding="utf-8"?> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
2 |
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
3 |
<!-- This component and the accompanying materials are made available under the terms of the License |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
4 |
"Eclipse Public License v1.0" which accompanies this distribution, |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
5 |
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
6 |
<!-- Initial Contributors: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
7 |
Nokia Corporation - initial contribution. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
8 |
Contributors: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
9 |
--> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
10 |
<!DOCTYPE reference |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
11 |
PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
12 |
<reference id="GUID-301037F1-1983-565A-88F9-633BBF0EBB91" xml:lang="en"><title>posixsignals: POSIX Signal Example, Using P.I.P.S.</title><shortdesc>This example demonstrates various signal use cases as supported |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
13 |
in P.I.P.S. </shortdesc><prolog><metadata><keywords/></metadata></prolog><refbody> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
14 |
<section id="GUID-CB373350-FF46-4535-BF8E-69F1CB3BA96E"><title>Purpose</title> <p>The example demonstrates the following use cases: </p> <ol> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
15 |
<li id="GUID-2449E06E-4B58-567F-977E-B949483EB5C2"><p>Sending and |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
16 |
handling a signal using the default handler </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
17 |
<li id="GUID-7E468336-5849-5900-BE63-5AAE64061463"><p>Sending and |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
18 |
handling a signal using a customized signal handler </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
19 |
<li id="GUID-0BE58B0C-9D2A-5CAE-BF98-CF5169532B41"><p>Ignoring an |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
20 |
incoming signal </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
21 |
<li id="GUID-585B9B29-DFA4-5530-8E4F-F2DC865C9D2C"><p>Blocking and |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
22 |
releasing a signal </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
23 |
<li id="GUID-A486A7E3-31AB-5AAF-B24F-F908CE687121"><p>Waiting for |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
24 |
a signal </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
25 |
<li id="GUID-E4F52B24-EDA0-57A7-AA1C-7B93EF91F3C1"><p>Generating and |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
26 |
handling a <codeph>SIGPIPE</codeph> signal </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
27 |
<li id="GUID-3D92B198-4827-5817-B28C-C1AC0B28CD6F"><p>Using a signal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
28 |
to gracefully terminate a process </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
29 |
<li id="GUID-D7F62326-7148-528E-9189-D9180123724E"><p>Using a signal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
30 |
to handle an asynchronous event </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
31 |
</ol><p> </p><p>The example delivers 3 sub projects: </p> <ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
32 |
<li id="GUID-F8B3EA5D-58D5-535D-BF5A-5E4639EE78FB"><p> <b>basicSignals:</b> This project demonstrates basic signal use cases. It shows the first |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
33 |
six use cases mentioned in the list above. The use cases are demonstrated |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
34 |
through <filepath>basicsignals.exe</filepath>. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
35 |
<li id="GUID-145641DC-753A-53C4-8AFA-4F38D754A293"><p> <b>sigtermSignal:</b> This project demonstrates the graceful termination of a process |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
36 |
using the <codeph>SIGTERM</codeph> signal. The use case is demonstrated |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
37 |
through <filepath>sigtermsignal.exe</filepath> and <filepath>raisesignal.exe</filepath>. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
38 |
<li id="GUID-899D801E-B669-560F-87AE-3C3AE095FB07"><p> <b>asyncSignal:</b> This project demonstrates asynchronous signal handling using the <codeph>SIGUSR1</codeph> signal and the <codeph>SIGUSR2</codeph> signal. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
39 |
The use case is demonstrated using <filepath>sigusr1.exe</filepath> and <filepath>sigusr2.exe</filepath>. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
40 |
</ul> </section> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
41 |
<section id="GUID-703F9106-A12C-4F0B-872B-F4A06FCEC1FC"><title>Description</title> <p>The use cases demonstrated in this example are described below.</p><p>Note: For clarity in the documentation for this example, signal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
42 |
names have been given in capitals whilst process names have been given |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
43 |
in lower case.</p><p><b>1. Sending and handling a signal using the |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
44 |
default handler </b> </p> <p>The default implementation of the signals |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
45 |
supported in P.I.P.S. will either terminate a process or ignore a |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
46 |
process. Signals are generated using the <codeph>Kill()</codeph> method |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
47 |
and they are handled as per the implementation in the default handler. </p> <p>To demonstrate this use case we use <codeph>SIGCHLD</codeph> and <codeph>SIGALRM</codeph> signals. <codeph>SIGCHLD</codeph> by default gets |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
48 |
ignored whenever it is raised, whereas <codeph>SIGALRM</codeph> causes |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
49 |
a process termination when raised. As a result the example terminates |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
50 |
whenever <codeph>SIGALRM</codeph> is raised, whereas an info message |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
51 |
is printed when <codeph>SIGCHLD</codeph> is raised. </p> <p><b>2. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
52 |
Sending and handling a signal using a customized signal handler </b> </p> <p>To override the default implementation of a signal a customized |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
53 |
handler can be defined. This customized handler can be set either |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
54 |
by using <codeph>sigaction()</codeph> or <codeph>signal()</codeph>. The <codeph>sigaction()</codeph> method takes <codeph>struct sigaction</codeph> as one of its parameters (the <codeph>sa_handler</codeph> member |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
55 |
of this structure is filled with the custom handler). Now whenever |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
56 |
a signal is generated the custom handler is executed. </p> <p>For |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
57 |
the demonstration of this particular use case, <codeph>SIGCHLD</codeph> and <codeph>SIGALRM</codeph> signals are used. These signals are |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
58 |
assigned custom handler functions. The handlers for these signals |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
59 |
contains a simple user message. Thus, whenever the signals are raised, |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
60 |
the customized signal handlers get invoked instead of the default |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
61 |
handlers. </p> <p><b>3. Ignoring an incoming signal </b> </p> <p>A |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
62 |
signal can be ignored by setting <codeph>SIG_IGN</codeph> in the <codeph>sa_handler</codeph> member of <codeph>struct sigaction</codeph>. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
63 |
The demonstration of this use case also uses <codeph>SIGCHLD</codeph> and <codeph>SIGALRM</codeph> signals, and as a result of setting <codeph>SIG_IGN</codeph> in <codeph>sa_handler</codeph> the signals are ignored |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
64 |
when raised. </p> <p><b>4. Blocking and releasing a signal </b> </p> <p>A signal can be blocked by first adding it to the blocking set |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
65 |
(a list of signals we want to block, when a signal is executing) by |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
66 |
using the <codeph>sigaddset()</codeph> method and then calling the<codeph> sigprocmask()</codeph> function. Once a signal is blocked it will |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
67 |
always be ignored upon generation. The <codeph>sigrelse()</codeph> method is used to unblock a signal. </p> <p>Demonstration of this |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
68 |
use case involves the <codeph>SIGUSR1</codeph> and <codeph>SIGUSR2</codeph> signals. Both <codeph>SIGUSR1 </codeph>and <codeph>SIGUSR2</codeph> are user-defined signals. We first block the <codeph>SIGUSR1</codeph> signal by adding it to the blocking set and making a call to the <codeph>sigprocmask()</codeph> function. Now whenever <codeph>SIGUSR1</codeph> is raised it will get ignored as it is blocked. <codeph>SIGUSR1</codeph> will keep waiting in the pending queue until it is released. The |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
69 |
release of <codeph>SIGUSR1</codeph> happens in the <codeph>SIGUSR2</codeph> signal handler. Once <codeph>SIGUSR1</codeph> is released, it is |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
70 |
removed from the pending queue and its handler function is called |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
71 |
to handle it. </p> <p><b>5. Waiting for a signal </b> </p> <p>Before |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
72 |
a process can wait on a particular signal, it has to add the signal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
73 |
to the mask set (which is a list of signals we want to block) and |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
74 |
then call the <codeph>sigprocmask()</codeph> method. The process then |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
75 |
sets the timeout value using <codeph>struct timespec</codeph>. Once |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
76 |
this is done the process waits on a signal for a specified time period |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
77 |
using the<codeph>sigtimedwait()</codeph> method. If the signal is |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
78 |
not received within the specified time period, an error message is |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
79 |
generated. </p> <p>For the demonstration of this use case we are setting |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
80 |
a timeout of 5 seconds. The <codeph>SIGALRM</codeph> signal is raised |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
81 |
by a call to <codeph>alarm()</codeph> as and when the timer expires. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
82 |
There are two instances in the example where <codeph>SIGALRM</codeph> signal is raised, one after a duration of 4 seconds and one after |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
83 |
6 seconds. When <codeph>SIGALRM</codeph> is raised after 4 seconds, |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
84 |
it is well within the timeout limit (of 5 seconds) and hence the signal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
85 |
gets received but not handled. But when the alarm is raised after |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
86 |
6 seconds, timeout happens and an error is generated. Now as the <codeph>SIGALRM</codeph> signal was added to the mask set it never gets handled |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
87 |
even though it is received. To handle the signal we need to move it |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
88 |
from block state to unblock state, which we do using the <codeph>sigprocmask()</codeph> method. Once the signal gets unblocked its custom handler gets called. </p> <p><b>6. Generating and handling a <codeph>SIGPIPE</codeph> signal </b> </p> <p>The <codeph>SIGPIPE</codeph> signal is generated when writing |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
89 |
to a broken pipe. To achieve this broken pipe condition the read end |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
90 |
of the pipe (obtained using the <codeph>pipe() </codeph> function |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
91 |
call) is closed and then write to the pipe is done. The associated |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
92 |
handler function is executed in response to the raised <codeph>SIGPIPE</codeph> signal . </p> <p><b>7. Using a signal to gracefully terminate a |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
93 |
process </b> </p> <p>Graceful termination of process can be achieved |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
94 |
by using the <codeph>SIGTERM </codeph>signal. In the handler function |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
95 |
of the signal all the opened file descriptors need to be closed before |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
96 |
exiting. </p> <p>This use case is demonstrated using the <filepath>sigtermSignal</filepath> project. The project consists of two processes: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
97 |
the <filepath>sigtermsignal</filepath> process and the <filepath>raisesignal </filepath> process. </p> <ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
98 |
<li id="GUID-A2CC3DF9-0334-5638-A5E7-7828F319F5D0"> <p>The <filepath>sigtermsignal</filepath> process first defines a custom handler for |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
99 |
the <codeph>SIGTERM</codeph> signal that carries out the closing of |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
100 |
all the open file descriptors when the signal is raised. This is done |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
101 |
in order to achieve the graceful termination of the process. The <filepath>sigtermsignal</filepath> process then opens a file and obtains names |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
102 |
from user to be written in to it. It then simultaneously spawns a <filepath>raisesignal</filepath> process and starts reading from the file. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
103 |
When the <filepath>raisesignal</filepath> process sends a <codeph>SIGTERM</codeph> signal to the <filepath>sigtermsignal</filepath> process, the <filepath>sigtermsignal</filepath> process closes all |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
104 |
the open file descriptors and prepares to exit. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
105 |
<li id="GUID-05715C75-A100-563B-82D5-CAA4EFD44634"> <p>The <filepath>raisesignal</filepath> process sends the <codeph>SIGTERM</codeph> signal to the <filepath>sigtermsignal</filepath> process. The custom |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
106 |
handler of the <codeph>SIGTERM</codeph> signal takes care of properly |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
107 |
closing all opened file descriptors and then terminating the process. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
108 |
If the custom handler is not implemented, the default handler will |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
109 |
get called, which will result in process termination without closing |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
110 |
any opened file descriptors. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
111 |
</ul> <p><b>8. Using a signal to handle an asynchronous event </b> </p> <p> <codeph>The SIGUSR1</codeph> and <codeph>SIGUSR2</codeph> signals are used to demonstrate the handling of an asynchronous |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
112 |
event. These signals are sent from one process to another. On reception |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
113 |
of these signals, respective custom handlers are called and any necessary |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
114 |
action is taken. The action taken is purely implementation dependent |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
115 |
. </p> <p>This use case demonstration is performed using the <filepath>asyncSignal</filepath> project. The project consists of two processes: |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
116 |
the <filepath>sigusr1</filepath> process and the <filepath>sigusr2</filepath> process, where the <filepath>sigusr1</filepath> process handles |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
117 |
the <codeph>SIGUSR1</codeph> signal and sends the <codeph>SIGUSR2</codeph> signal to the <filepath>sigusr2</filepath> process. Whereas the<filepath> sigusr2</filepath> process handles the <codeph>SIGUSR2</codeph> signal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
118 |
and sends the <codeph>SIGUSR1</codeph> signal to the <filepath>sigusr1</filepath> process. </p> <ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
119 |
<li id="GUID-57116DD9-EB8E-57F0-9FFD-AA54F984F698"><p>The <filepath>sigusr1 </filepath> process assigns a custom handler for the <codeph>SIGUSR1</codeph> signal. It then opens a file in read and write mode |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
120 |
and write some content into the open file. Once write operation is |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
121 |
done the <filepath>sigusr1</filepath> process spawns <filepath>sigusr2</filepath> process and waits for <codeph>SIGUSR1 </codeph> signal from <filepath>sigusr2</filepath> process. On receiving <codeph>SIGUSR1</codeph> signal <filepath>sigusr1 </filepath> process starts reading from |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
122 |
the file. Once reading from the file is done and its contents are |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
123 |
displayed on the console, <filepath>sigusr1</filepath> process sends <codeph>SIGUSR2</codeph> signal to <filepath>sigusr2</filepath> process. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
124 |
It then closes all its open file descriptor and prepares to exit. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
125 |
<li id="GUID-9F878182-23B1-570C-986C-3B4E7B26F444"> <p>The<filepath> sigusr2</filepath> process is spawned from <filepath>sigusr1</filepath> process and it assigns a custom handler for <codeph>SIGUSR2</codeph> signal. It sends <codeph>SIGUSR1</codeph> signal to <filepath>sigusr1</filepath> process in order to start file read and then waits for <codeph>SIGUSR2 </codeph> signal from <filepath>sigusr1</filepath> process. When <filepath>sigusr2</filepath> process receives <codeph>SIGUSR2</codeph> signal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
126 |
it prepares to exit. </p> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
127 |
</ul> <p>Hence, the communication between the two processes happens |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
128 |
through the <codeph>SIGUSR1</codeph> and <codeph>SIGUSR2</codeph> signals |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
129 |
and asynchronous signal handling happens. </p> </section> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
130 |
<section id="GUID-E1661179-0268-4E49-A574-C7CC41D7A56B"><title>Download</title> <p>Click on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-5a633d12-547a-4439-9eca-104a655109ab.zip" scope="external">BasicSignals.zip</xref></p><p>Click on the following |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
131 |
link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-54523fba-51b5-436a-9403-99874fdc94c7 .zip" scope="external">SigtermSignal.zip</xref></p><p>Click on the following |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
132 |
link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-7714a392-161f-4dc7-b8e6-311e42e1deb8 .zip" scope="external">AsyncSignal.zip</xref></p><p/><p>To view the BasicSignal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
133 |
example source click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-5a633d12-547a-4439-9eca-104a655109ab.html" scope="peer">browseBasicSignals</xref></p><p>To view the SigtermSignal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
134 |
example source click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-54523fba-51b5-436a-9403-99874fdc94c7.html" scope="peer">browseSigtermSignal</xref></p><p>To view the AsyncSignal |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
135 |
example source click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-7714a392-161f-4dc7-b8e6-311e42e1deb8.html" scope="peer">browseAsyncSignal</xref></p> </section> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
136 |
<section id="GUID-38492A50-BF1B-4A33-8125-397D646ED8A7"><title>Building |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
137 |
and configuring</title> <p>You can build the example from your IDE |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
138 |
or the command line: </p> <ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
139 |
<li id="GUID-0D86ECCB-1501-52D9-A52E-A016AB6710A2"><p> </p><p>If you |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
140 |
use an IDE, import the <filepath>bld.inf</filepath> file of the example |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
141 |
into your IDE, and use the build command of the IDE. </p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
142 |
<li> <p>If you use the command line, open a command prompt, and set |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
143 |
the current directory to the source code directory of the example. |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
144 |
You can then build the example with the SBSv1 build tools using the |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
145 |
following commands: </p><ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
146 |
<li><p><cmdname>bldmake bldfiles</cmdname></p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
147 |
<li><p><cmdname>abld build</cmdname></p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
148 |
</ul> </li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
149 |
</ul> <p> </p><p>The example builds the following executables :<ul> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
150 |
<li><p><filepath>basicsignals.exe</filepath> : for basic signal use |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
151 |
cases demonstration. </p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
152 |
<li><p><filepath>sigtermsignal.exe</filepath> : for demonstrating |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
153 |
graceful termination of process .</p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
154 |
<li><p><filepath>raisesignal.exe</filepath> : for sending <codeph>SIGTERM</codeph> signal.</p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
155 |
<li><p><filepath>sigusr1.exe</filepath> : for demonstrating asynchronous |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
156 |
event handling , sending <codeph>SIGUSR2</codeph> signal and receiving <codeph>SIGUSR1</codeph> signal. </p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
157 |
<li><p><filepath>sigusr2.exe</filepath> : for sending <codeph><codeph>SIGUSR1</codeph></codeph> signal and receiving <codeph>SIGUSR2</codeph> signal.</p></li> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
158 |
</ul></p><p> in the <filepath>epoc32\release\winscw\<udeb or urel>\</filepath> folder. </p><p> </p></section> |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
159 |
<section id="GUID-1CB8164D-030D-41CD-B146-3E4D14CB1A9B"><title>Running |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
160 |
the example</title> <p><b>NOTE : </b> </p> <p> <filepath>basicsignals.exe</filepath> should be executed first for running the first six uses cases mentioned |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
161 |
above. </p> <p> <filepath>sigtermsignal.exe</filepath> should be executed |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
162 |
for running the seventh use case. </p> <p> <filepath>sigusr1.exe</filepath> should be executed for running the last use case. </p> <p>The <filepath>sigtermsignal</filepath> process internally spawns the<filepath> raisesignal</filepath> process for taking an input from the user and sending the <codeph>SIGTERM</codeph> signal. You should not run the <filepath>raisesignal</filepath> process explicitly. You should only run <filepath>sigtermsignal.exe</filepath> as the <filepath>sigtermsignal</filepath> process takes proper care |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
163 |
of launching the <filepath>raisesignal</filepath> process. </p> <p>The <filepath>sigusr1</filepath> process also internally spawns the <filepath>sigusr2</filepath> process. </p> <p>The <filepath>sigusr1</filepath> process sends the <codeph>SIGUSR2</codeph> signal to the <filepath>sigusr2</filepath> process and receives the <codeph>SIGUSR1</codeph> signal from it. </p> <p>The <filepath>sigusr2</filepath> process |
48780e181b38
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
164 |
sends the <codeph>SIGUSR1</codeph> signal to the <filepath>sigusr1</filepath> process and receives the <codeph>SIGUSR2</codeph> signal from it. </p> <p>As the <filepath>sigusr1 </filepath>process spawns the <filepath>sigusr2</filepath> process, hence you should run <filepath>sigusr1.exe</filepath> only. </p> <p>In order to toggle between the processes use <cmdname>Alt+ctrl+shift+T</cmdname> and observe the behavior. </p> </section> |
7
51a74ef9ed63
Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
165 |
</refbody></reference> |