<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pthread cancel on HPUX in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pthread-cancel-on-hpux/m-p/4988616#M98382</link>
    <description>This is a bug in HP and they have promised to release an official patch for this. Till now no  official patch is available.</description>
    <pubDate>Wed, 13 Sep 2006 02:37:08 GMT</pubDate>
    <dc:creator>Manish_33</dc:creator>
    <dc:date>2006-09-13T02:37:08Z</dc:date>
    <item>
      <title>pthread cancel on HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-cancel-on-hpux/m-p/4988614#M98380</link>
      <description>Hello friends,&lt;BR /&gt;&lt;BR /&gt; I am having some confusions regarding use of pthread_cancel and&lt;BR /&gt;pthread_cleanup_push. Even though i have made my thread as&lt;BR /&gt;cancellation enabled and asynchronous cancellation enabled.....it&lt;BR /&gt;doesn't seem to catch them unless a cancellation point is&lt;BR /&gt;reached.......Could someone throw some light on this.......Below is my&lt;BR /&gt;sample program...&lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;SIGNAL.H&gt;&lt;BR /&gt;#include&lt;PTHREAD.H&gt;&lt;BR /&gt;&lt;BR /&gt;pthread_t stid;&lt;BR /&gt;&lt;BR /&gt;void hndlr(void *a){&lt;BR /&gt; printf("I am in pthread handler\n");&lt;BR /&gt; return ;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void *sstart(void *tid){&lt;BR /&gt; int oldstate;&lt;BR /&gt;&lt;BR /&gt;  fprintf(stderr,"Starting second child tid=%d\n",pthread_self());&lt;BR /&gt;&lt;BR /&gt;  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,&amp;amp;oldstate);   /*Enable&lt;BR /&gt;cancellation again*/&lt;BR /&gt;  fprintf(stderr,"Enabled cancelling, old state was %d\n",oldstate);&lt;BR /&gt;  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,&amp;amp;oldstate);&lt;BR /&gt;/*Enable asynchronous cancellation*/&lt;BR /&gt;  fprintf(stderr,"Enabled asynchronous cancelling, old state was&lt;BR /&gt;%d\n",oldstate);&lt;BR /&gt;&lt;BR /&gt;  pthread_cleanup_push(hndlr,NULL);&lt;BR /&gt;  printf("\nI have pushed a function\n");&lt;BR /&gt;  pthread_cancel(pthread_self());&lt;BR /&gt;  printf("\nThis is a cancellation point.\n");&lt;BR /&gt;  pthread_cleanup_pop(0);&lt;BR /&gt;  return NULL ;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main(){&lt;BR /&gt; pthread_attr_t attr;&lt;BR /&gt; pthread_attr_init(&amp;amp;attr);&lt;BR /&gt; pthread_create(&amp;amp;stid,&amp;amp;attr,sstart,NULL);&lt;BR /&gt; pthread_join(stid,NULL);&lt;BR /&gt;  return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As you can see if i comment out the printf statement..."This is a&lt;BR /&gt;cancellation point" the handler will not be called.....Why is that i&lt;BR /&gt;need an explicit cancelation point ??&lt;/PTHREAD.H&gt;&lt;/SIGNAL.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Mon, 03 Jul 2006 05:39:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-cancel-on-hpux/m-p/4988614#M98380</guid>
      <dc:creator>Manish_33</dc:creator>
      <dc:date>2006-07-03T05:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: pthread cancel on HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-cancel-on-hpux/m-p/4988615#M98381</link>
      <description>It appears you have moved this discussion to:&lt;BR /&gt;HPUX-DEVTOOLS: Cancellation points in HP</description>
      <pubDate>Mon, 10 Jul 2006 22:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-cancel-on-hpux/m-p/4988615#M98381</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-07-10T22:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: pthread cancel on HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-cancel-on-hpux/m-p/4988616#M98382</link>
      <description>This is a bug in HP and they have promised to release an official patch for this. Till now no  official patch is available.</description>
      <pubDate>Wed, 13 Sep 2006 02:37:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-cancel-on-hpux/m-p/4988616#M98382</guid>
      <dc:creator>Manish_33</dc:creator>
      <dc:date>2006-09-13T02:37:08Z</dc:date>
    </item>
  </channel>
</rss>

