Symbian3/PDK/Source/GUID-CF6014E9-FB59-4715-B245-5826090DDF28.dita
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
   117 <li><p>connect with the file server before file operations</p></li>
   117 <li><p>connect with the file server before file operations</p></li>
   118 <li><p>connect with the socket server for socket-related operation</p></li>
   118 <li><p>connect with the socket server for socket-related operation</p></li>
   119 <li><p>connect to the communication server before serial communication operation</p></li>
   119 <li><p>connect to the communication server before serial communication operation</p></li>
   120 </ul></p><p>P.I.P.S. eliminates all these operations. P.I.P.S. allows the
   120 </ul></p><p>P.I.P.S. eliminates all these operations. P.I.P.S. allows the
   121 user to code, as if it were done for the UNIX or Linux environment and lets
   121 user to code, as if it were done for the UNIX or Linux environment and lets
   122 the user link the application with P.I.P.S..</p></section>
   122 the user link the application with P.I.P.S.</p></section>
   123 <section id="GUID-AFAE7FDA-8829-4FF7-991F-D65EBAA652F2"><title>Thread creation</title><p>This
   123 <section id="GUID-AFAE7FDA-8829-4FF7-991F-D65EBAA652F2"><title>Thread creation</title><p>This
   124 section deals with thread creation in the UNIX and Symbian platform environments.</p><codeblock xml:space="preserve">/* Thread creation in UNIX environment*/
   124 section deals with thread creation in the UNIX and Symbian platform environments.</p><codeblock xml:space="preserve">/* Thread creation in UNIX environment*/
   125    void* ThreadEntryPoint( void* aParam );
   125    void* ThreadEntryPoint( void* aParam );
   126    int exitReason = 0;
   126    int exitReason = 0;
   127    int retVal  = 0;
   127    int retVal  = 0;
   130    pthread_attr_init(&amp;threadAttr);
   130    pthread_attr_init(&amp;threadAttr);
   131    retVal = pthread_create(&amp;threadID, &amp;threadAttr, ThreadEntryPoint, (void*)NULL );
   131    retVal = pthread_create(&amp;threadID, &amp;threadAttr, ThreadEntryPoint, (void*)NULL );
   132    if(retVal == 0) {
   132    if(retVal == 0) {
   133        retVal = pthread_join(threadID1, (void**)&amp;exitReason);
   133        retVal = pthread_join(threadID1, (void**)&amp;exitReason);
   134    }
   134    }
   135 </codeblock><codeblock xml:space="preserve">// Thread creation in Symbian OS
   135 </codeblock><codeblock xml:space="preserve">// Thread creation in Symbian Platform
   136   TInt ThreadEntryPoint( TAny* aData );
   136   TInt ThreadEntryPoint( TAny* aData );
   137
   137
   138   RThread thread;
   138   RThread thread;
   139   thread.Create(_L("MY-THREAD"), ThreadEntryPoint, 4096, NULL, NULL);
   139   thread.Create(_L("MY-THREAD"), ThreadEntryPoint, 4096, NULL, NULL);
   140   TRequestStatus stat;
   140   TRequestStatus stat;