<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-07-31)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-07-31 Joel Sherrill <joel.sherrilL@OARcorp.com>

        PR 1855/cpukit
        * posix/src/psignal.c, posix/src/pthread.c, posix/src/pthreadjoin.c:
        Correct signal processing during pthread_join. We are supposed to
        unblock the thread waiting on a pthread_join(), dispatch the signal
        handler, account for it potentially overwriting errno, and then have
        the thread return to blocking within pthread_join().
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2892&r2=text&tr2=1.2893&diff_format=h">M</a></td><td width='1%'>1.2893</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/psignal.c.diff?r1=text&tr1=1.70&r2=text&tr2=1.71&diff_format=h">M</a></td><td width='1%'>1.71</td><td width='100%'>cpukit/posix/src/psignal.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthread.c.diff?r1=text&tr1=1.84&r2=text&tr2=1.85&diff_format=h">M</a></td><td width='1%'>1.85</td><td width='100%'>cpukit/posix/src/pthread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthreadjoin.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/posix/src/pthreadjoin.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2892 rtems/cpukit/ChangeLog:1.2893
--- rtems/cpukit/ChangeLog:1.2892       Sun Jul 31 11:15:59 2011
+++ rtems/cpukit/ChangeLog      Sun Jul 31 17:40:22 2011
</font><font color='#997700'>@@ -1,5 +1,14 @@
</font> 2011-07-31        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
<font color='#000088'>+   PR 1855/cpukit
+       * posix/src/psignal.c, posix/src/pthread.c, posix/src/pthreadjoin.c:
+       Correct signal processing during pthread_join. We are supposed to
+       unblock the thread waiting on a pthread_join(), dispatch the signal
+       handler, account for it potentially overwriting errno, and then have
+       the thread return to blocking within pthread_join().
+
+2011-07-31     Joel Sherrill <joel.sherrilL@OARcorp.com>
+
</font>   PR 1867/cpukit
        * posix/src/pthreadexit.c, posix/src/pthreadjoin.c: Correct
        implementation of pthread_exit() and pthread_join() to support the

<font color='#006600'>diff -u rtems/cpukit/posix/src/psignal.c:1.70 rtems/cpukit/posix/src/psignal.c:1.71
--- rtems/cpukit/posix/src/psignal.c:1.70       Sun Jul 24 18:55:08 2011
+++ rtems/cpukit/posix/src/psignal.c    Sun Jul 31 17:40:23 2011
</font><font color='#997700'>@@ -112,10 +112,17 @@
</font>   POSIX_API_Control  *api;
   int                 signo;
   ISR_Level           level;
<font color='#000088'>+  int                 hold_errno;
</font> 
   api = the_thread->API_Extensions[ THREAD_API_POSIX ];
 
   /*
<font color='#000088'>+   *  We need to ensure that if the signal handler executes a call
+   *  which overwrites the unblocking status, we restore it.
+   */
+  hold_errno = _Thread_Executing->Wait.return_code;
+
+  /*
</font>    * api may be NULL in case of a thread close in progress
    */
   if ( !api )
<font color='#997700'>@@ -149,6 +156,8 @@
</font>       _POSIX_signals_Check_signal( api, signo, true );
     }
   }
<font color='#000088'>+
+  _Thread_Executing->Wait.return_code = hold_errno;
</font> }
 
 /*

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthread.c:1.84 rtems/cpukit/posix/src/pthread.c:1.85
--- rtems/cpukit/posix/src/pthread.c:1.84       Wed Jul 27 12:17:49 2011
+++ rtems/cpukit/posix/src/pthread.c    Sun Jul 31 17:40:23 2011
</font><font color='#997700'>@@ -217,7 +217,7 @@
</font>   _Thread_queue_Initialize(
     &api->Join_List,
     THREAD_QUEUE_DISCIPLINE_FIFO,
<font color='#880000'>-    STATES_WAITING_FOR_JOIN_AT_EXIT,
</font><font color='#000088'>+    STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_INTERRUPTIBLE_BY_SIGNAL,
</font>     0
   );
 

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthreadjoin.c:1.12 rtems/cpukit/posix/src/pthreadjoin.c:1.13
--- rtems/cpukit/posix/src/pthreadjoin.c:1.12   Sun Jul 31 11:16:00 2011
+++ rtems/cpukit/posix/src/pthreadjoin.c        Sun Jul 31 17:40:23 2011
</font><font color='#997700'>@@ -1,7 +1,7 @@
</font> /*
  *  16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
  *
<font color='#880000'>- *  COPYRIGHT (c) 1989-2007.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2011.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -32,6 +32,7 @@
</font>   Objects_Locations        location;
   void                    *return_pointer;
 
<font color='#000088'>+on_EINTR:
</font>   the_thread = _Thread_Get( thread, &location );
   switch ( location ) {
 
<font color='#997700'>@@ -66,6 +67,9 @@
</font>       }
       _Thread_Enable_dispatch();
 
<font color='#000088'>+      if ( _Thread_Executing->Wait.return_code == EINTR )
+        goto on_EINTR;
+
</font>       if ( value_ptr )
         *value_ptr = return_pointer;
       return 0;
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file .cvsignore was added on branch rtems-4-9-branch on 2011-07-31 22:41:17 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/.cvsignore</font></td></tr>
</table>
<p> </p>
<a name='cs3'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file .cvsignore was added on branch rtems-4-10-branch on 2011-07-31 22:40:53 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/.cvsignore</font></td></tr>
</table>
<p> </p>
<a name='cs4'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file psxeintr_join.doc was added on branch rtems-4-9-branch on 2011-07-31 22:41:17 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/psxeintr_join.doc</font></td></tr>
</table>
<p> </p>
<a name='cs5'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file init.c was added on branch rtems-4-9-branch on 2011-07-31 22:41:17 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/init.c</font></td></tr>
</table>
<p> </p>
<a name='cs6'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file Makefile.am was added on branch rtems-4-10-branch on 2011-07-31 22:40:53 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/Makefile.am</font></td></tr>
</table>
<p> </p>
<a name='cs7'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file psxeintr_join.scn was added on branch rtems-4-9-branch on 2011-07-31 22:41:17 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/psxeintr_join.scn</font></td></tr>
</table>
<p> </p>
<a name='cs8'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file psxeintr_join.doc was added on branch rtems-4-10-branch on 2011-07-31 22:40:53 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/psxeintr_join.doc</font></td></tr>
</table>
<p> </p>
<a name='cs9'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>branches:  1.1.2;  1.1.4;
2011-07-31      Joel Sherrill <joel.sherrilL@OARcorp.com>

        PR 1855/cpukit
        * Makefile.am, configure.ac: Correct signal processing during
        pthread_join. We are supposed to unblock the thread waiting on a
        pthread_join(), dispatch the signal handler, account for it
        potentially overwriting errno, and then have the thread return to
        blocking within pthread_join().
        * psxeintr_join/.cvsignore, psxeintr_join/Makefile.am,
        psxeintr_join/init.c, psxeintr_join/psxeintr_join.doc,
        psxeintr_join/psxeintr_join.scn: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxeintr_join/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxeintr_join/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxeintr_join/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxeintr_join/psxeintr_join.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtests/psxeintr_join/psxeintr_join.scn</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/.cvsignore:1.1
--- /dev/null   Sun Jul 31 18:10:58 2011
+++ rtems/testsuites/psxtests/psxeintr_join/.cvsignore  Sun Jul 31 17:40:30 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/Makefile.am:1.1
--- /dev/null   Sun Jul 31 18:10:58 2011
+++ rtems/testsuites/psxtests/psxeintr_join/Makefile.am Sun Jul 31 17:40:31 2011
</font><font color='#997700'>@@ -0,0 +1,25 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+rtems_tests_PROGRAMS = psxeintr_join
+psxeintr_join_SOURCES = init.c
+
+dist_rtems_tests_DATA = psxeintr_join.scn
+dist_rtems_tests_DATA += psxeintr_join.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxeintr_join_OBJECTS) $(psxeintr_join_LDADD)
+LINK_LIBS = $(psxeintr_join_LDLIBS)
+
+psxeintr_join$(EXEEXT): $(psxeintr_join_OBJECTS) $(psxeintr_join_DEPENDENCIES)
+       @rm -f psxeintr_join$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/init.c:1.1
--- /dev/null   Sun Jul 31 18:10:58 2011
+++ rtems/testsuites/psxtests/psxeintr_join/init.c      Sun Jul 31 17:40:31 2011
</font><font color='#997700'>@@ -0,0 +1,125 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <semaphore.h>
+#include <pthread.h>
+
+#include <rtems.h>
+#include <tmacros.h>
+#include "test_support.h"
+
+#define SIG_SUSPEND SIGUSR1
+#define SIG_THR_RESTART SIGUSR2
+
+sem_t GC_suspend_ack_sem;
+
+static void print_sig_mask( const char * str )
+{
+  sigset_t blocked;
+  int      i;
+  int      status;
+
+  status = pthread_sigmask( SIG_BLOCK, NULL, &blocked );
+  rtems_test_assert( status == 0 );
+
+  printf( "%s blocked:\n", str );
+  for ( i = 1; i < NSIG; i++) {
+    if ( sigismember( &blocked, i ) )
+      printf( "%d ", i );
+  }
+  printf( "\n" );
+}
+
+void GC_suspend_handler( int sig )
+{
+  puts( "run in GC_suspend_handler" );
+  sem_post( &GC_suspend_ack_sem );
+}
+
+void GC_restart_handler( int sig )
+{
+  puts( "run in GC_restart_handler" );
+}
+
+void* run( void *arg )
+{
+  int       status;
+  pthread_t id = *(pthread_t *)arg;
+
+  print_sig_mask( "New Thread" );
+
+  status = pthread_kill( id, SIG_SUSPEND );
+  rtems_test_assert( status == 0 );
+
+  puts( "New Thread: after pthread_kill" );
+  status = sem_wait( &GC_suspend_ack_sem );
+  rtems_test_assert( status == 0 );
+
+  puts( "New Thread over!" );
+  return NULL;
+}
+
+void *POSIX_Init( void *arg )
+{
+  struct sigaction act;
+  pthread_t        newThread;
+  pthread_t        mainThread;
+  int              status;
+
+  puts( "*** POSIX TEST PSXEINTR_JOIN ***" );
+  status = sem_init( &GC_suspend_ack_sem, 0, 0);
+  rtems_test_assert( status == 0 );
+
+  status = sigemptyset( &act.sa_mask );
+  rtems_test_assert( status == 0 );
+
+  status = sigaddset( &act.sa_mask, SIG_SUSPEND );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_sigmask( SIG_UNBLOCK, &act.sa_mask, NULL );
+  rtems_test_assert( status == 0 );
+
+  act.sa_handler = GC_suspend_handler;
+
+  status = sigaction( SIG_SUSPEND, &act, NULL );
+  rtems_test_assert( status == 0 );
+
+  act.sa_handler = GC_restart_handler;
+
+  print_sig_mask( "Main Thread" );
+
+  mainThread = pthread_self();
+  status = pthread_create( &newThread, NULL, run, &mainThread );
+  rtems_test_assert( status == 0 );
+
+  pthread_join( newThread, NULL );
+  puts( "Back from pthread_join" );
+
+  puts( "*** END OF POSIX TEST PSXEINTR_JOIN ***" );
+  rtems_test_exit( 0 );
+
+  return NULL;
+}
+
+/* configuration information */
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
+#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */
+
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc:1.1
--- /dev/null   Sun Jul 31 18:10:58 2011
+++ rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc   Sun Jul 31 17:40:31 2011
</font><font color='#997700'>@@ -0,0 +1,24 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2011.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  psxeintr_join
+
+directives:
+
+  + pthread_join
+  + pthread_kill
+
+concepts:
+
++ Verify that a signal sent during a blocking pthread_join() call is properly
+  processed.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn:1.1
--- /dev/null   Sun Jul 31 18:10:58 2011
+++ rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn   Sun Jul 31 17:40:31 2011
</font><font color='#997700'>@@ -0,0 +1,9 @@
</font><font color='#000088'>+*** POSIX TEST PSXEINTR_JOIN ***
+Main Thread blocked: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 27 28 29 30 31<span style="background-color: #FF0000"> </span>
+New Thread blocked: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 27 28 29 30 31<span style="background-color: #FF0000"> </span>
+New Thread: after pthread_kill
+run in GC_suspend_handler
+New Thread over!
+Back from pthread_join
+*** END OF POSIX TEST PSXEINTR_JOIN ***
+
</font></pre>
<p> </p>
<a name='cs10'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file init.c was added on branch rtems-4-10-branch on 2011-07-31 22:40:53 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/init.c</font></td></tr>
</table>
<p> </p>
<a name='cs11'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file psxeintr_join.scn was added on branch rtems-4-10-branch on 2011-07-31 22:40:53 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/psxeintr_join.scn</font></td></tr>
</table>
<p> </p>
<a name='cs12'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>file Makefile.am was added on branch rtems-4-9-branch on 2011-07-31 22:41:17 +0000
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">R</a></td><td width='1%'><font color="#880000">1.1</font></td><td width='100%'><font color="#880000">testsuites/psxtests/psxeintr_join/Makefile.am</font></td></tr>
</table>
<p> </p>
<a name='cs13'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
 <font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-07-31 Joel Sherrill <joel.sherrilL@OARcorp.com>

        PR 1855/cpukit
        * Makefile.am, configure.ac: Correct signal processing during
        pthread_join. We are supposed to unblock the thread waiting on a
        pthread_join(), dispatch the signal handler, account for it
        potentially overwriting errno, and then have the thread return to
        blocking within pthread_join().
        * psxeintr_join/.cvsignore, psxeintr_join/Makefile.am,
        psxeintr_join/init.c, psxeintr_join/psxeintr_join.doc,
        psxeintr_join/psxeintr_join.scn: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.348&r2=text&tr2=1.349&diff_format=h">M</a></td><td width='1%'>1.349</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.264.2.4&r2=text&tr2=1.264.2.5&diff_format=h">M</a></td><td width='1%'>1.264.2.5</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/Makefile.am.diff?r1=text&tr1=1.76&r2=text&tr2=1.77&diff_format=h">M</a></td><td width='1%'>1.77</td><td width='100%'>testsuites/psxtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/Makefile.am.diff?r1=text&tr1=1.58.2.1&r2=text&tr2=1.58.2.2&diff_format=h">M</a></td><td width='1%'>1.58.2.2</td><td width='100%'>testsuites/psxtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/configure.ac.diff?r1=text&tr1=1.84&r2=text&tr2=1.85&diff_format=h">M</a></td><td width='1%'>1.85</td><td width='100%'>testsuites/psxtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/configure.ac.diff?r1=text&tr1=1.61.2.4&r2=text&tr2=1.61.2.5&diff_format=h">M</a></td><td width='1%'>1.61.2.5</td><td width='100%'>testsuites/psxtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/.cvsignore.diff?r1=text&tr1=1.1.2.1&r2=text&tr2=1.1.2.2&diff_format=h">M</a></td><td width='1%'>1.1.2.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/.cvsignore</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/Makefile.am.diff?r1=text&tr1=1.1.2.1&r2=text&tr2=1.1.2.2&diff_format=h">M</a></td><td width='1%'>1.1.2.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/init.c.diff?r1=text&tr1=1.1.2.1&r2=text&tr2=1.1.2.2&diff_format=h">M</a></td><td width='1%'>1.1.2.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc.diff?r1=text&tr1=1.1.2.1&r2=text&tr2=1.1.2.2&diff_format=h">M</a></td><td width='1%'>1.1.2.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/psxeintr_join.doc</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn.diff?r1=text&tr1=1.1.2.1&r2=text&tr2=1.1.2.2&diff_format=h">M</a></td><td width='1%'>1.1.2.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/psxeintr_join.scn</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.348 rtems/testsuites/psxtests/ChangeLog:1.349
--- rtems/testsuites/psxtests/ChangeLog:1.348   Sun Jul 31 11:16:17 2011
+++ rtems/testsuites/psxtests/ChangeLog Sun Jul 31 17:40:30 2011
</font><font color='#997700'>@@ -1,5 +1,17 @@
</font> 2011-07-31        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
<font color='#000088'>+   PR 1855/cpukit
+       * Makefile.am, configure.ac: Correct signal processing during
+       pthread_join. We are supposed to unblock the thread waiting on a
+       pthread_join(), dispatch the signal handler, account for it
+       potentially overwriting errno, and then have the thread return to
+       blocking within pthread_join().
+       * psxeintr_join/.cvsignore, psxeintr_join/Makefile.am,
+       psxeintr_join/init.c, psxeintr_join/psxeintr_join.doc,
+       psxeintr_join/psxeintr_join.scn: New files.
+
+2011-07-31     Joel Sherrill <joel.sherrilL@OARcorp.com>
+
</font>   PR 1867/cpukit
        * Makefile.am, configure.ac, psx12/task.c, psxkey03/init.c,
        psxrwlock01/test.c: Correct implementation of pthread_exit() and

<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.264.2.4 rtems/testsuites/psxtests/ChangeLog:1.264.2.5
--- rtems/testsuites/psxtests/ChangeLog:1.264.2.4       Sun Jul 31 11:16:42 2011
+++ rtems/testsuites/psxtests/ChangeLog Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -1,5 +1,17 @@
</font> 2011-07-31        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
<font color='#000088'>+   PR 1855/cpukit
+       * Makefile.am, configure.ac: Correct signal processing during
+       pthread_join. We are supposed to unblock the thread waiting on a
+       pthread_join(), dispatch the signal handler, account for it
+       potentially overwriting errno, and then have the thread return to
+       blocking within pthread_join().
+       * psxeintr_join/.cvsignore, psxeintr_join/Makefile.am,
+       psxeintr_join/init.c, psxeintr_join/psxeintr_join.doc,
+       psxeintr_join/psxeintr_join.scn: New files.
+
+2011-07-31     Joel Sherrill <joel.sherrilL@OARcorp.com>
+
</font>   PR 1867/cpukit
        * Makefile.am, configure.ac, psx12/task.c, psxkey03/init.c,
        psxrwlock01/test.c: Correct implementation of pthread_exit() and

<font color='#006600'>diff -u rtems/testsuites/psxtests/Makefile.am:1.76 rtems/testsuites/psxtests/Makefile.am:1.77
--- rtems/testsuites/psxtests/Makefile.am:1.76  Sun Jul 31 11:16:17 2011
+++ rtems/testsuites/psxtests/Makefile.am       Sun Jul 31 17:40:30 2011
</font><font color='#997700'>@@ -17,7 +17,8 @@
</font>     psxsignal03 psxsignal04 psxsignal05 psxsignal06 \
     psxspin01 psxspin02 psxsysconf \
     psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
<font color='#880000'>-    psxintrcritical01 psxstack01 psxstack02
</font><font color='#000088'>+    psxintrcritical01 psxstack01 psxstack02 \
+    psxeintr_join
</font> endif
 
 ## File IO tests

<font color='#006600'>diff -u rtems/testsuites/psxtests/Makefile.am:1.58.2.1 rtems/testsuites/psxtests/Makefile.am:1.58.2.2
--- rtems/testsuites/psxtests/Makefile.am:1.58.2.1      Sun Jul 31 11:16:43 2011
+++ rtems/testsuites/psxtests/Makefile.am       Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -15,7 +15,7 @@
</font>     psxmutexattr01 psxobj01 psxrwlock01 psxsem01 psxsignal01 psxsignal02 \
     psxsignal03 psxsignal04 psxsignal05 psxspin01 psxspin02 psxsysconf \
     psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
<font color='#880000'>-    psxintrcritical01 psxstack01
</font><font color='#000088'>+    psxintrcritical01 psxstack01 psxeintr_join
</font> endif
 
 ## File IO tests

<font color='#006600'>diff -u rtems/testsuites/psxtests/configure.ac:1.84 rtems/testsuites/psxtests/configure.ac:1.85
--- rtems/testsuites/psxtests/configure.ac:1.84 Sun Jul 31 11:16:17 2011
+++ rtems/testsuites/psxtests/configure.ac      Sun Jul 31 17:40:30 2011
</font><font color='#997700'>@@ -112,6 +112,7 @@
</font> psxcleanup01/Makefile
 psxclock/Makefile
 psxcond01/Makefile
<font color='#000088'>+psxeintr_join/Makefile
</font> psxenosys/Makefile
 psxfatal01/Makefile
 psxfatal02/Makefile

<font color='#006600'>diff -u rtems/testsuites/psxtests/configure.ac:1.61.2.4 rtems/testsuites/psxtests/configure.ac:1.61.2.5
--- rtems/testsuites/psxtests/configure.ac:1.61.2.4     Sun Jul 31 11:16:43 2011
+++ rtems/testsuites/psxtests/configure.ac      Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -86,6 +86,7 @@
</font> psxcleanup01/Makefile
 psxclock/Makefile
 psxcond01/Makefile
<font color='#000088'>+psxeintr_join/Makefile
</font> psxenosys/Makefile
 psxfatal01/Makefile
 psxfatal02/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/.cvsignore:1.1.2.2
--- /dev/null   Sun Jul 31 18:10:59 2011
+++ rtems/testsuites/psxtests/psxeintr_join/.cvsignore  Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/Makefile.am:1.1.2.2
--- /dev/null   Sun Jul 31 18:10:59 2011
+++ rtems/testsuites/psxtests/psxeintr_join/Makefile.am Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -0,0 +1,25 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+rtems_tests_PROGRAMS = psxeintr_join
+psxeintr_join_SOURCES = init.c
+
+dist_rtems_tests_DATA = psxeintr_join.scn
+dist_rtems_tests_DATA += psxeintr_join.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxeintr_join_OBJECTS) $(psxeintr_join_LDADD)
+LINK_LIBS = $(psxeintr_join_LDLIBS)
+
+psxeintr_join$(EXEEXT): $(psxeintr_join_OBJECTS) $(psxeintr_join_DEPENDENCIES)
+       @rm -f psxeintr_join$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/init.c:1.1.2.2
--- /dev/null   Sun Jul 31 18:10:59 2011
+++ rtems/testsuites/psxtests/psxeintr_join/init.c      Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -0,0 +1,125 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <semaphore.h>
+#include <pthread.h>
+
+#include <rtems.h>
+#include <tmacros.h>
+#include "test_support.h"
+
+#define SIG_SUSPEND SIGUSR1
+#define SIG_THR_RESTART SIGUSR2
+
+sem_t GC_suspend_ack_sem;
+
+static void print_sig_mask( const char * str )
+{
+  sigset_t blocked;
+  int      i;
+  int      status;
+
+  status = pthread_sigmask( SIG_BLOCK, NULL, &blocked );
+  rtems_test_assert( status == 0 );
+
+  printf( "%s blocked:\n", str );
+  for ( i = 1; i < NSIG; i++) {
+    if ( sigismember( &blocked, i ) )
+      printf( "%d ", i );
+  }
+  printf( "\n" );
+}
+
+void GC_suspend_handler( int sig )
+{
+  puts( "run in GC_suspend_handler" );
+  sem_post( &GC_suspend_ack_sem );
+}
+
+void GC_restart_handler( int sig )
+{
+  puts( "run in GC_restart_handler" );
+}
+
+void* run( void *arg )
+{
+  int       status;
+  pthread_t id = *(pthread_t *)arg;
+
+  print_sig_mask( "New Thread" );
+
+  status = pthread_kill( id, SIG_SUSPEND );
+  rtems_test_assert( status == 0 );
+
+  puts( "New Thread: after pthread_kill" );
+  status = sem_wait( &GC_suspend_ack_sem );
+  rtems_test_assert( status == 0 );
+
+  puts( "New Thread over!" );
+  return NULL;
+}
+
+void *POSIX_Init( void *arg )
+{
+  struct sigaction act;
+  pthread_t        newThread;
+  pthread_t        mainThread;
+  int              status;
+
+  puts( "*** POSIX TEST PSXEINTR_JOIN ***" );
+  status = sem_init( &GC_suspend_ack_sem, 0, 0);
+  rtems_test_assert( status == 0 );
+
+  status = sigemptyset( &act.sa_mask );
+  rtems_test_assert( status == 0 );
+
+  status = sigaddset( &act.sa_mask, SIG_SUSPEND );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_sigmask( SIG_UNBLOCK, &act.sa_mask, NULL );
+  rtems_test_assert( status == 0 );
+
+  act.sa_handler = GC_suspend_handler;
+
+  status = sigaction( SIG_SUSPEND, &act, NULL );
+  rtems_test_assert( status == 0 );
+
+  act.sa_handler = GC_restart_handler;
+
+  print_sig_mask( "Main Thread" );
+
+  mainThread = pthread_self();
+  status = pthread_create( &newThread, NULL, run, &mainThread );
+  rtems_test_assert( status == 0 );
+
+  pthread_join( newThread, NULL );
+  puts( "Back from pthread_join" );
+
+  puts( "*** END OF POSIX TEST PSXEINTR_JOIN ***" );
+  rtems_test_exit( 0 );
+
+  return NULL;
+}
+
+/* configuration information */
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
+#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */
+
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc:1.1.2.2
--- /dev/null   Sun Jul 31 18:10:59 2011
+++ rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc   Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -0,0 +1,24 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2011.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  psxeintr_join
+
+directives:
+
+  + pthread_join
+  + pthread_kill
+
+concepts:
+
++ Verify that a signal sent during a blocking pthread_join() call is properly
+  processed.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn:1.1.2.2
--- /dev/null   Sun Jul 31 18:10:59 2011
+++ rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn   Sun Jul 31 17:40:53 2011
</font><font color='#997700'>@@ -0,0 +1,9 @@
</font><font color='#000088'>+*** POSIX TEST PSXEINTR_JOIN ***
+Main Thread blocked: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 27 28 29 30 31<span style="background-color: #FF0000"> </span>
+New Thread blocked: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 27 28 29 30 31<span style="background-color: #FF0000"> </span>
+New Thread: after pthread_kill
+run in GC_suspend_handler
+New Thread over!
+Back from pthread_join
+*** END OF POSIX TEST PSXEINTR_JOIN ***
+
</font></pre>
<p> </p>
<a name='cs14'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
 <font color='#225522'><em>(on branch rtems-4-9-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-07-31 Joel Sherrill <joel.sherrilL@OARcorp.com>

        PR 1855/cpukit
        * posix/src/psignal.c, posix/src/psignalunblockthread.c,
        posix/src/pthread.c, posix/src/pthreadjoin.c: Correct signal
        processing during pthread_join. We are supposed to unblock the thread
        waiting on a pthread_join(), dispatch the signal handler, account for
        it potentially overwriting errno, and then have the thread return to
        blocking within pthread_join().
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.1539.2.79&r2=text&tr2=1.1539.2.80&diff_format=h">M</a></td><td width='1%'>1.1539.2.80</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.100&r2=text&tr2=1.2346.2.101&diff_format=h">M</a></td><td width='1%'>1.2346.2.101</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/psignal.c.diff?r1=text&tr1=1.60&r2=text&tr2=1.60.2.1&diff_format=h">M</a></td><td width='1%'>1.60.2.1</td><td width='100%'>cpukit/posix/src/psignal.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/psignal.c.diff?r1=text&tr1=1.67.2.1&r2=text&tr2=1.67.2.2&diff_format=h">M</a></td><td width='1%'>1.67.2.2</td><td width='100%'>cpukit/posix/src/psignal.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/psignalunblockthread.c.diff?r1=text&tr1=1.8&r2=text&tr2=1.8.2.1&diff_format=h">M</a></td><td width='1%'>1.8.2.1</td><td width='100%'>cpukit/posix/src/psignalunblockthread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/psignalunblockthread.c.diff?r1=text&tr1=1.10&r2=text&tr2=1.10.2.1&diff_format=h">M</a></td><td width='1%'>1.10.2.1</td><td width='100%'>cpukit/posix/src/psignalunblockthread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthread.c.diff?r1=text&tr1=1.68&r2=text&tr2=1.68.2.1&diff_format=h">M</a></td><td width='1%'>1.68.2.1</td><td width='100%'>cpukit/posix/src/pthread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthread.c.diff?r1=text&tr1=1.80&r2=text&tr2=1.80.2.1&diff_format=h">M</a></td><td width='1%'>1.80.2.1</td><td width='100%'>cpukit/posix/src/pthread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthreadjoin.c.diff?r1=text&tr1=1.8.4.2&r2=text&tr2=1.8.4.3&diff_format=h">M</a></td><td width='1%'>1.8.4.3</td><td width='100%'>cpukit/posix/src/pthreadjoin.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthreadjoin.c.diff?r1=text&tr1=1.8.2.2&r2=text&tr2=1.8.2.3&diff_format=h">M</a></td><td width='1%'>1.8.2.3</td><td width='100%'>cpukit/posix/src/pthreadjoin.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.1539.2.79 rtems/cpukit/ChangeLog:1.1539.2.80
--- rtems/cpukit/ChangeLog:1.1539.2.79  Sun Jul 31 11:16:53 2011
+++ rtems/cpukit/ChangeLog      Sun Jul 31 17:41:04 2011
</font><font color='#997700'>@@ -1,5 +1,15 @@
</font> 2011-07-31        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
<font color='#000088'>+   PR 1855/cpukit
+       * posix/src/psignal.c, posix/src/psignalunblockthread.c,
+       posix/src/pthread.c, posix/src/pthreadjoin.c: Correct signal
+       processing during pthread_join. We are supposed to unblock the thread
+       waiting on a pthread_join(), dispatch the signal handler, account for
+       it potentially overwriting errno, and then have the thread return to
+       blocking within pthread_join().
+
+2011-07-31     Joel Sherrill <joel.sherrilL@OARcorp.com>
+
</font>   PR 1867/cpukit
        * posix/src/pthreadexit.c, posix/src/pthreadjoin.c: Correct
        implementation of pthread_exit() and pthread_join() to support the

<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.100 rtems/cpukit/ChangeLog:1.2346.2.101
--- rtems/cpukit/ChangeLog:1.2346.2.100 Sun Jul 31 11:16:28 2011
+++ rtems/cpukit/ChangeLog      Sun Jul 31 17:40:41 2011
</font><font color='#997700'>@@ -1,5 +1,15 @@
</font> 2011-07-31        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
<font color='#000088'>+   PR 1855/cpukit
+       * posix/src/psignal.c, posix/src/psignalunblockthread.c,
+       posix/src/pthread.c, posix/src/pthreadjoin.c: Correct signal
+       processing during pthread_join. We are supposed to unblock the thread
+       waiting on a pthread_join(), dispatch the signal handler, account for
+       it potentially overwriting errno, and then have the thread return to
+       blocking within pthread_join().
+
+2011-07-31     Joel Sherrill <joel.sherrilL@OARcorp.com>
+
</font>   PR 1867/cpukit
        * posix/src/pthreadexit.c, posix/src/pthreadjoin.c: Correct
        implementation of pthread_exit() and pthread_join() to support the

<font color='#006600'>diff -u rtems/cpukit/posix/src/psignal.c:1.60 rtems/cpukit/posix/src/psignal.c:1.60.2.1
--- rtems/cpukit/posix/src/psignal.c:1.60       Thu Sep  4 10:23:12 2008
+++ rtems/cpukit/posix/src/psignal.c    Sun Jul 31 17:41:06 2011
</font><font color='#997700'>@@ -1,5 +1,5 @@
</font> /*
<font color='#880000'>- *  COPYRIGHT (c) 1989-2007.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2011.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -106,6 +106,13 @@
</font>   POSIX_API_Control  *api;
   int                 signo;
   ISR_Level           level;
<font color='#000088'>+  int                 hold_errno;
+
+  /*
+   *  We need to ensure that if the signal handler executes a call
+   *  which overwrites the unblocking status, we restore it.
+   */
+  hold_errno = _Thread_Executing->Wait.return_code;
</font> 
   api = the_thread->API_Extensions[ THREAD_API_POSIX ];
   if ( !api )

<font color='#006600'>diff -u rtems/cpukit/posix/src/psignal.c:1.67.2.1 rtems/cpukit/posix/src/psignal.c:1.67.2.2
--- rtems/cpukit/posix/src/psignal.c:1.67.2.1   Fri Jan 21 13:31:34 2011
+++ rtems/cpukit/posix/src/psignal.c    Sun Jul 31 17:40:43 2011
</font><font color='#997700'>@@ -113,10 +113,17 @@
</font>   POSIX_API_Control  *api;
   int                 signo;
   ISR_Level           level;
<font color='#000088'>+  int                 hold_errno;
</font> 
   api = the_thread->API_Extensions[ THREAD_API_POSIX ];
 
   /*
<font color='#000088'>+   *  We need to ensure that if the signal handler executes a call
+   *  which overwrites the unblocking status, we restore it.
+   */
+  hold_errno = _Thread_Executing->Wait.return_code;
+
+  /*
</font>    * api may be NULL in case of a thread close in progress
    */
   if ( !api )
<font color='#997700'>@@ -150,6 +157,8 @@
</font>       _POSIX_signals_Check_signal( api, signo, true );
     }
   }
<font color='#000088'>+
+  _Thread_Executing->Wait.return_code = hold_errno;
</font> }
 
 /*PAGE

<font color='#006600'>diff -u rtems/cpukit/posix/src/psignalunblockthread.c:1.8 rtems/cpukit/posix/src/psignalunblockthread.c:1.8.2.1
--- rtems/cpukit/posix/src/psignalunblockthread.c:1.8   Thu Sep  4 10:23:12 2008
+++ rtems/cpukit/posix/src/psignalunblockthread.c       Sun Jul 31 17:41:06 2011
</font><font color='#997700'>@@ -1,5 +1,5 @@
</font> /*
<font color='#880000'>- *  COPYRIGHT (c) 1989-2007.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2011.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -103,21 +103,16 @@
</font>     if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
       the_thread->Wait.return_code = EINTR;
       /*
<font color='#880000'>-       *  At this time, there is no RTEMS API object which lets a task
-       *  block on a thread queue and be interruptible by a POSIX signal.
-       *  If an object class with that requirement is ever added, enable
-       *  this code.
</font><font color='#000088'>+       *  In pthread_cond_wait, a thread will be blocking on a thread
+       *  queue, but is also interruptible by a POSIX signal.
</font>        */
<font color='#880000'>-      #if 0
-       if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
-         _Thread_queue_Extract_with_proxy( the_thread );
-       else
-      #endif
-         if ( _States_Is_delaying(the_thread->current_state) ){
-           if ( _Watchdog_Is_active( &the_thread->Timer ) )
-             (void) _Watchdog_Remove( &the_thread->Timer );
-           _Thread_Unblock( the_thread );
-         }
</font><font color='#000088'>+      if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
+        _Thread_queue_Extract_with_proxy( the_thread );
+      else if ( _States_Is_delaying(the_thread->current_state) ){
+       (void) _Watchdog_Remove( &the_thread->Timer );
+        _Thread_Unblock( the_thread );
+      }
+
</font>     } else if ( the_thread->current_state == STATES_READY ) {
       if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
        _ISR_Signals_to_thread_executing = TRUE;

<font color='#006600'>diff -u rtems/cpukit/posix/src/psignalunblockthread.c:1.10 rtems/cpukit/posix/src/psignalunblockthread.c:1.10.2.1
--- rtems/cpukit/posix/src/psignalunblockthread.c:1.10  Mon Nov 30 09:44:21 2009
+++ rtems/cpukit/posix/src/psignalunblockthread.c       Sun Jul 31 17:40:43 2011
</font><font color='#997700'>@@ -1,5 +1,5 @@
</font> /*
<font color='#880000'>- *  COPYRIGHT (c) 1989-2007.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2011.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -100,24 +100,19 @@
</font> 
     the_thread->do_post_task_switch_extension = true;
 
<font color='#880000'>-    if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
</font><font color='#000088'>+    if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
</font>       the_thread->Wait.return_code = EINTR;
       /*
<font color='#880000'>-       *  At this time, there is no RTEMS API object which lets a task
-       *  block on a thread queue and be interruptible by a POSIX signal.
-       *  If an object class with that requirement is ever added, enable
-       *  this code.
</font><font color='#000088'>+       *  In pthread_cond_wait, a thread will be blocking on a thread
+       *  queue, but is also interruptible by a POSIX signal.
</font>        */
<font color='#880000'>-      #if 0
-       if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
-         _Thread_queue_Extract_with_proxy( the_thread );
-       else
-      #endif
-         if ( _States_Is_delaying(the_thread->current_state) ){
-           if ( _Watchdog_Is_active( &the_thread->Timer ) )
-             (void) _Watchdog_Remove( &the_thread->Timer );
-           _Thread_Unblock( the_thread );
-         }
</font><font color='#000088'>+      if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
+        _Thread_queue_Extract_with_proxy( the_thread );
+      else if ( _States_Is_delaying(the_thread->current_state) ){
+       (void) _Watchdog_Remove( &the_thread->Timer );
+        _Thread_Unblock( the_thread );
+      }
+
</font>     } else if ( the_thread->current_state == STATES_READY ) {
       if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
        _ISR_Signals_to_thread_executing = true;

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthread.c:1.68 rtems/cpukit/posix/src/pthread.c:1.68.2.1
--- rtems/cpukit/posix/src/pthread.c:1.68       Thu Sep  4 10:23:12 2008
+++ rtems/cpukit/posix/src/pthread.c    Sun Jul 31 17:41:06 2011
</font><font color='#997700'>@@ -185,7 +185,7 @@
</font>   _Thread_queue_Initialize(
     &api->Join_List,
     THREAD_QUEUE_DISCIPLINE_FIFO,
<font color='#880000'>-    STATES_WAITING_FOR_JOIN_AT_EXIT,
</font><font color='#000088'>+    STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_INTERRUPTIBLE_BY_SIGNAL,
</font>     0
   );
 

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthread.c:1.80 rtems/cpukit/posix/src/pthread.c:1.80.2.1
--- rtems/cpukit/posix/src/pthread.c:1.80       Sun Apr 25 14:51:12 2010
+++ rtems/cpukit/posix/src/pthread.c    Sun Jul 31 17:40:43 2011
</font><font color='#997700'>@@ -214,7 +214,7 @@
</font>   _Thread_queue_Initialize(
     &api->Join_List,
     THREAD_QUEUE_DISCIPLINE_FIFO,
<font color='#880000'>-    STATES_WAITING_FOR_JOIN_AT_EXIT,
</font><font color='#000088'>+    STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_INTERRUPTIBLE_BY_SIGNAL,
</font>     0
   );
 

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthreadjoin.c:1.8.4.2 rtems/cpukit/posix/src/pthreadjoin.c:1.8.4.3
--- rtems/cpukit/posix/src/pthreadjoin.c:1.8.4.2        Sun Jul 31 11:16:30 2011
+++ rtems/cpukit/posix/src/pthreadjoin.c        Sun Jul 31 17:40:43 2011
</font><font color='#997700'>@@ -1,7 +1,7 @@
</font> /*
  *  16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
  *
<font color='#880000'>- *  COPYRIGHT (c) 1989-2007.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2011.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -32,6 +32,7 @@
</font>   Objects_Locations        location;
   void                    *return_pointer;
 
<font color='#000088'>+on_EINTR:
</font>   the_thread = _Thread_Get( thread, &location );
   switch ( location ) {
 
<font color='#997700'>@@ -66,6 +67,9 @@
</font>       }
       _Thread_Enable_dispatch();
 
<font color='#000088'>+      if ( _Thread_Executing->Wait.return_code == EINTR )
+        goto on_EINTR;
+
</font>       if ( value_ptr )
         *value_ptr = return_pointer;
       return 0;

<font color='#006600'>diff -u rtems/cpukit/posix/src/pthreadjoin.c:1.8.2.2 rtems/cpukit/posix/src/pthreadjoin.c:1.8.2.3
--- rtems/cpukit/posix/src/pthreadjoin.c:1.8.2.2        Sun Jul 31 11:16:55 2011
+++ rtems/cpukit/posix/src/pthreadjoin.c        Sun Jul 31 17:41:06 2011
</font><font color='#997700'>@@ -1,7 +1,7 @@
</font> /*
  *  16.1.3 Wait for Thread Termination, P1003.1c/Draft 10, p. 147
  *
<font color='#880000'>- *  COPYRIGHT (c) 1989-2007.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2011.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -32,6 +32,7 @@
</font>   Objects_Locations        location;
   void                    *return_pointer;
 
<font color='#000088'>+on_EINTR:
</font>   the_thread = _Thread_Get( thread, &location );
   switch ( location ) {
 
<font color='#997700'>@@ -66,6 +67,9 @@
</font>       }
       _Thread_Enable_dispatch();
 
<font color='#000088'>+      if ( _Thread_Executing->Wait.return_code == EINTR )
+        goto on_EINTR;
+
</font>       if ( value_ptr )
         *value_ptr = return_pointer;
       return 0;
</pre>
<p> </p>
<a name='cs15'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
 <font color='#225522'><em>(on branch rtems-4-9-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-07-31 Joel Sherrill <joel.sherrilL@OARcorp.com>

        PR 1855/cpukit
        * Makefile.am, configure.ac, psx16/Makefile.am: Correct signal
        processing during pthread_join. We are supposed to unblock the thread
        waiting on a pthread_join(), dispatch the signal handler, account for
        it potentially overwriting errno, and then have the thread return to
        blocking within pthread_join().
        * psxeintr_join/.cvsignore, psxeintr_join/Makefile.am,
        psxeintr_join/init.c, psxeintr_join/psxeintr_join.doc,
        psxeintr_join/psxeintr_join.scn: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/ChangeLog.diff?r1=text&tr1=1.125.2.1&r2=text&tr2=1.125.2.2&diff_format=h">M</a></td><td width='1%'>1.125.2.2</td><td width='100%'>testsuites/psxtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/Makefile.am.diff?r1=text&tr1=1.32.2.1&r2=text&tr2=1.32.2.2&diff_format=h">M</a></td><td width='1%'>1.32.2.2</td><td width='100%'>testsuites/psxtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/configure.ac.diff?r1=text&tr1=1.31.2.1&r2=text&tr2=1.31.2.2&diff_format=h">M</a></td><td width='1%'>1.31.2.2</td><td width='100%'>testsuites/psxtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psx16/Makefile.am.diff?r1=text&tr1=1.1.4.2&r2=text&tr2=1.1.4.3&diff_format=h">M</a></td><td width='1%'>1.1.4.3</td><td width='100%'>testsuites/psxtests/psx16/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/.cvsignore.diff?r1=text&tr1=1.1.4.1&r2=text&tr2=1.1.4.2&diff_format=h">M</a></td><td width='1%'>1.1.4.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/.cvsignore</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/Makefile.am.diff?r1=text&tr1=1.1.4.1&r2=text&tr2=1.1.4.2&diff_format=h">M</a></td><td width='1%'>1.1.4.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/init.c.diff?r1=text&tr1=1.1.4.1&r2=text&tr2=1.1.4.2&diff_format=h">M</a></td><td width='1%'>1.1.4.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc.diff?r1=text&tr1=1.1.4.1&r2=text&tr2=1.1.4.2&diff_format=h">M</a></td><td width='1%'>1.1.4.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/psxeintr_join.doc</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn.diff?r1=text&tr1=1.1.4.1&r2=text&tr2=1.1.4.2&diff_format=h">M</a></td><td width='1%'>1.1.4.2</td><td width='100%'>testsuites/psxtests/psxeintr_join/psxeintr_join.scn</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtests/ChangeLog:1.125.2.1 rtems/testsuites/psxtests/ChangeLog:1.125.2.2
--- rtems/testsuites/psxtests/ChangeLog:1.125.2.1       Sun Jul 31 11:17:02 2011
+++ rtems/testsuites/psxtests/ChangeLog Sun Jul 31 17:41:16 2011
</font><font color='#997700'>@@ -1,5 +1,17 @@
</font> 2011-07-31        Joel Sherrill <joel.sherrilL@OARcorp.com>
 
<font color='#000088'>+   PR 1855/cpukit
+       * Makefile.am, configure.ac, psx16/Makefile.am: Correct signal
+       processing during pthread_join. We are supposed to unblock the thread
+       waiting on a pthread_join(), dispatch the signal handler, account for
+       it potentially overwriting errno, and then have the thread return to
+       blocking within pthread_join().
+       * psxeintr_join/.cvsignore, psxeintr_join/Makefile.am,
+       psxeintr_join/init.c, psxeintr_join/psxeintr_join.doc,
+       psxeintr_join/psxeintr_join.scn: New files.
+
+2011-07-31     Joel Sherrill <joel.sherrilL@OARcorp.com>
+
</font>   PR 1867/cpukit
        * Makefile.am, configure.ac, psx12/task.c, psxrwlock01/test.c: Correct
        implementation of pthread_exit() and pthread_join() to support the

<font color='#006600'>diff -u rtems/testsuites/psxtests/Makefile.am:1.32.2.1 rtems/testsuites/psxtests/Makefile.am:1.32.2.2
--- rtems/testsuites/psxtests/Makefile.am:1.32.2.1      Sun Jul 31 11:17:02 2011
+++ rtems/testsuites/psxtests/Makefile.am       Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -6,9 +6,9 @@
</font> 
 SUBDIRS = psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
     psx10 psx11 psx12 psx13 psx14 psx16 psxcleanup psxtime psxtimer01 \
<font color='#880000'>-    psxtimer02 psxcancel psxbarrier01 psxmsgq01 psxmsgq02 psxrwlock01
-    psxsem01 psxspin01 psxenosys psxsignal01 psxsysconf psxualarm psxkey01 \
-    psxfatal01 psxfatal02
</font><font color='#000088'>+    psxtimer02 psxcancel psxbarrier01 psxmsgq01 psxmsgq02 psxrwlock01 \
+    psxsem01 psxspin01 psxeintr_join psxenosys psxsignal01 psxsysconf \
+    psxualarm psxkey01 psxfatal01 psxfatal02
</font> 
 ## File IO tests
 SUBDIRS += psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01<span style="background-color: #FF0000"> </span>

<font color='#006600'>diff -u rtems/testsuites/psxtests/configure.ac:1.31.2.1 rtems/testsuites/psxtests/configure.ac:1.31.2.2
--- rtems/testsuites/psxtests/configure.ac:1.31.2.1     Sun Jul 31 11:17:02 2011
+++ rtems/testsuites/psxtests/configure.ac      Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -46,6 +46,7 @@
</font> psxcancel/Makefile
 psxchroot01/Makefile
 psxcleanup/Makefile
<font color='#000088'>+psxeintr_join/Makefile
</font> psxenosys/Makefile
 psxfatal01/Makefile
 psxfatal02/Makefile

<font color='#006600'>diff -u rtems/testsuites/psxtests/psx16/Makefile.am:1.1.4.2 rtems/testsuites/psxtests/psx16/Makefile.am:1.1.4.3
--- rtems/testsuites/psxtests/psx16/Makefile.am:1.1.4.2 Sun Jul 31 11:17:02 2011
+++ rtems/testsuites/psxtests/psx16/Makefile.am Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -2,24 +2,27 @@
</font> ## $Id$
 ##
 
<font color='#880000'>-rtems_tests_PROGRAMS = psx16
-psx16_SOURCES = init.c
</font><font color='#000088'>+MANAGERS = all
+
+rtems_tests_PROGRAMS = psx16.exe
+psx16_exe_SOURCES = init.c
</font> 
 dist_rtems_tests_DATA = psx16.scn
<font color='#880000'>-dist_rtems_tests_DATA += psx16.doc
</font> 
 include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
 include $(top_srcdir)/../automake/compile.am
 include $(top_srcdir)/../automake/leaf.am
 
<font color='#000088'>+psx16_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
</font> AM_CPPFLAGS += -I$(top_srcdir)/include
 AM_CPPFLAGS += -I$(top_srcdir)/../support/include
 
<font color='#880000'>-LINK_OBJS = $(psx16_OBJECTS) $(psx16_LDADD)
-LINK_LIBS = $(psx16_LDLIBS)
</font><font color='#000088'>+LINK_OBJS = $(psx16_exe_OBJECTS) $(psx16_exe_LDADD)
+LINK_LIBS = $(psx16_exe_LDLIBS)
</font> 
<font color='#880000'>-psx16$(EXEEXT): $(psx16_OBJECTS) $(psx16_DEPENDENCIES)
-       @rm -f psx16$(EXEEXT)
</font><font color='#000088'>+psx16.exe$(EXEEXT): $(psx16_exe_OBJECTS) $(psx16_exe_DEPENDENCIES)
+       @rm -f psx16.exe$(EXEEXT)
</font>   $(make-exe)
 
 include $(top_srcdir)/../automake/local.am

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/.cvsignore:1.1.4.2
--- /dev/null   Sun Jul 31 18:11:03 2011
+++ rtems/testsuites/psxtests/psxeintr_join/.cvsignore  Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/Makefile.am:1.1.4.2
--- /dev/null   Sun Jul 31 18:11:03 2011
+++ rtems/testsuites/psxtests/psxeintr_join/Makefile.am Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -0,0 +1,28 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxeintr_join.exe
+psxeintr_join_exe_SOURCES = init.c
+
+dist_rtems_tests_DATA = psxeintr_join.scn
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+psxeintr_join_exe_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxeintr_join_exe_OBJECTS) $(psxeintr_join_exe_LDADD)
+LINK_LIBS = $(psxeintr_join_exe_LDLIBS)
+
+psxeintr_join.exe$(EXEEXT): $(psxeintr_join_exe_OBJECTS) $(psxeintr_join_exe_DEPENDENCIES)
+       @rm -f psxeintr_join.exe$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/init.c:1.1.4.2
--- /dev/null   Sun Jul 31 18:11:03 2011
+++ rtems/testsuites/psxtests/psxeintr_join/init.c      Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -0,0 +1,125 @@
</font><font color='#000088'>+/*
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <semaphore.h>
+#include <pthread.h>
+
+#include <rtems.h>
+#include <tmacros.h>
+#include "test_support.h"
+
+#define SIG_SUSPEND SIGUSR1
+#define SIG_THR_RESTART SIGUSR2
+
+sem_t GC_suspend_ack_sem;
+
+static void print_sig_mask( const char * str )
+{
+  sigset_t blocked;
+  int      i;
+  int      status;
+
+  status = pthread_sigmask( SIG_BLOCK, NULL, &blocked );
+  rtems_test_assert( status == 0 );
+
+  printf( "%s blocked:\n", str );
+  for ( i = 1; i < NSIG; i++) {
+    if ( sigismember( &blocked, i ) )
+      printf( "%d ", i );
+  }
+  printf( "\n" );
+}
+
+void GC_suspend_handler( int sig )
+{
+  puts( "run in GC_suspend_handler" );
+  sem_post( &GC_suspend_ack_sem );
+}
+
+void GC_restart_handler( int sig )
+{
+  puts( "run in GC_restart_handler" );
+}
+
+void* run( void *arg )
+{
+  int       status;
+  pthread_t id = *(pthread_t *)arg;
+
+  print_sig_mask( "New Thread" );
+
+  status = pthread_kill( id, SIG_SUSPEND );
+  rtems_test_assert( status == 0 );
+
+  puts( "New Thread: after pthread_kill" );
+  status = sem_wait( &GC_suspend_ack_sem );
+  rtems_test_assert( status == 0 );
+
+  puts( "New Thread over!" );
+  return NULL;
+}
+
+void *POSIX_Init( void *arg )
+{
+  struct sigaction act;
+  pthread_t        newThread;
+  pthread_t        mainThread;
+  int              status;
+
+  puts( "*** POSIX TEST PSXEINTR_JOIN ***" );
+  status = sem_init( &GC_suspend_ack_sem, 0, 0);
+  rtems_test_assert( status == 0 );
+
+  status = sigemptyset( &act.sa_mask );
+  rtems_test_assert( status == 0 );
+
+  status = sigaddset( &act.sa_mask, SIG_SUSPEND );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_sigmask( SIG_UNBLOCK, &act.sa_mask, NULL );
+  rtems_test_assert( status == 0 );
+
+  act.sa_handler = GC_suspend_handler;
+
+  status = sigaction( SIG_SUSPEND, &act, NULL );
+  rtems_test_assert( status == 0 );
+
+  act.sa_handler = GC_restart_handler;
+
+  print_sig_mask( "Main Thread" );
+
+  mainThread = pthread_self();
+  status = pthread_create( &newThread, NULL, run, &mainThread );
+  rtems_test_assert( status == 0 );
+
+  pthread_join( newThread, NULL );
+  puts( "Back from pthread_join" );
+
+  puts( "*** END OF POSIX TEST PSXEINTR_JOIN ***" );
+  rtems_test_exit( 0 );
+
+  return NULL;
+}
+
+/* configuration information */
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
+#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */
+
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc:1.1.4.2
--- /dev/null   Sun Jul 31 18:11:03 2011
+++ rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.doc   Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -0,0 +1,24 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  COPYRIGHT (c) 1989-2011.
+#  On-Line Applications Research Corporation (OAR).
+#
+#  The license and distribution terms for this file may be
+#  found in the file LICENSE in this distribution or at
+#  http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name:  psxeintr_join
+
+directives:
+
+  + pthread_join
+  + pthread_kill
+
+concepts:
+
++ Verify that a signal sent during a blocking pthread_join() call is properly
+  processed.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn:1.1.4.2
--- /dev/null   Sun Jul 31 18:11:03 2011
+++ rtems/testsuites/psxtests/psxeintr_join/psxeintr_join.scn   Sun Jul 31 17:41:17 2011
</font><font color='#997700'>@@ -0,0 +1,9 @@
</font><font color='#000088'>+*** POSIX TEST PSXEINTR_JOIN ***
+Main Thread blocked: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 27 28 29 30 31<span style="background-color: #FF0000"> </span>
+New Thread blocked: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 27 28 29 30 31<span style="background-color: #FF0000"> </span>
+New Thread: after pthread_kill
+run in GC_suspend_handler
+New Thread over!
+Back from pthread_join
+*** END OF POSIX TEST PSXEINTR_JOIN ***
+
</font></pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>