Index: testsuites/psxtests/ChangeLog
===================================================================
--- testsuites/psxtests/ChangeLog	(revision 33c46f1a7014a1aa2e403aa7d089259cd09508b1)
+++ testsuites/psxtests/ChangeLog	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
@@ -1,2 +1,10 @@
+2010-10-21	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile.am, configure.ac: New test to ensure pthread_cond_wait() and
+	sleep() (e.g. interruptible blocking and sleeping) are interruptible
+	by signal.
+	* psxsignal06/.cvsignore, psxsignal06/Makefile.am, psxsignal06/init.c,
+	psxsignal06/psxsignal06.doc, psxsignal06/psxsignal06.scn: New files.
+
 2010-10-21	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: testsuites/psxtests/Makefile.am
===================================================================
--- testsuites/psxtests/Makefile.am	(revision 33c46f1a7014a1aa2e403aa7d089259cd09508b1)
+++ testsuites/psxtests/Makefile.am	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
@@ -14,5 +14,6 @@
     psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 \
     psxmutexattr01 psxobj01 psxrwlock01 psxsem01 psxsignal01 psxsignal02 \
-    psxsignal03 psxsignal04 psxsignal05 psxspin01 psxspin02 psxsysconf \
+    psxsignal03 psxsignal04 psxsignal05 psxsignal06 \
+    psxspin01 psxspin02 psxsysconf \
     psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
     psxintrcritical01 psxstack01 psxstack02
Index: testsuites/psxtests/configure.ac
===================================================================
--- testsuites/psxtests/configure.ac	(revision 33c46f1a7014a1aa2e403aa7d089259cd09508b1)
+++ testsuites/psxtests/configure.ac	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
@@ -143,4 +143,5 @@
 psxsignal04/Makefile
 psxsignal05/Makefile
+psxsignal06/Makefile
 psxspin01/Makefile
 psxspin02/Makefile
Index: testsuites/psxtests/psxsignal06/.cvsignore
===================================================================
--- testsuites/psxtests/psxsignal06/.cvsignore	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
+++ testsuites/psxtests/psxsignal06/.cvsignore	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Index: testsuites/psxtests/psxsignal06/Makefile.am
===================================================================
--- testsuites/psxtests/psxsignal06/Makefile.am	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
+++ testsuites/psxtests/psxsignal06/Makefile.am	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
@@ -0,0 +1,25 @@
+##
+## $Id$
+##
+
+rtems_tests_PROGRAMS = psxsignal06
+psxsignal06_SOURCES = init.c
+
+dist_rtems_tests_DATA = psxsignal06.scn
+dist_rtems_tests_DATA += psxsignal06.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 = $(psxsignal06_OBJECTS) $(psxsignal06_LDADD)
+LINK_LIBS = $(psxsignal06_LDLIBS)
+
+psxsignal06$(EXEEXT): $(psxsignal06_OBJECTS) $(psxsignal06_DEPENDENCIES)
+	@rm -f psxsignal06$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/psxtests/psxsignal06/init.c
===================================================================
--- testsuites/psxtests/psxsignal06/init.c	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
+++ testsuites/psxtests/psxsignal06/init.c	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
@@ -0,0 +1,124 @@
+/*
+ *  COPYRIGHT (c) 1989-2010.
+ *  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 <tmacros.h>
+#include "test_support.h"
+#include <pthread.h>
+#include <errno.h>
+
+pthread_t       ThreadId;
+pthread_cond_t  CondVarId;
+pthread_mutex_t MutexId;
+
+void Handler(
+  int signo
+)
+{
+}
+
+void *TestThread(
+  void *argument
+)
+{
+  int               status;
+  sigset_t          mask;
+  struct sigaction  act;
+  unsigned int      left;
+
+  /* unblock SIGUSR1 */
+  status = sigemptyset( &mask );
+  rtems_test_assert(  !status );
+
+  status = sigaddset( &mask, SIGUSR1 );
+  rtems_test_assert(  !status );
+
+  puts( "Test: Unblock SIGUSR1" );
+  status = sigprocmask( SIG_UNBLOCK, &mask, NULL );
+  rtems_test_assert(  !status );
+
+  /* install a signal handler for SIGUSR1 */
+  act.sa_handler = Handler;
+  act.sa_flags   = 0;
+  sigaction( SIGUSR1, &act, NULL );
+
+  /* interrupting condition wait returns 0 */
+  puts( "Test: pthread_cond_wait - OK" );
+  status = pthread_cond_wait( &CondVarId, &MutexId );
+  rtems_test_assert( !status );
+  puts( "Test: pthread_cond_wait - interrupted by signal" );
+
+  left = sleep( 10 );
+  printf( "Test: seconds left=%d\n", left );
+
+  return NULL;
+}
+
+void *POSIX_Init(
+  rtems_task_argument argument
+)
+{
+  int status;
+
+  puts( "\n\n*** POSIX TEST SIGNAL 06 ***" );
+
+  puts( "Init: pthread_cond_init - OK" );
+  status = pthread_cond_init( &CondVarId, NULL );
+  rtems_test_assert(  !status );
+
+  puts( "Init: pthread_mutex_init - OK" );
+  status = pthread_mutex_init( &MutexId, NULL );
+  rtems_test_assert(  !status );
+
+  puts( "Init: pthread_create - OK" );
+  status = pthread_create( &ThreadId, NULL, TestThread, NULL );
+  rtems_test_assert( !status );
+
+  sleep( 1 );
+
+     /* let TestThread run */
+
+  puts( "Init: pthread_kill - SIGUSR to Test Thread - OK" );
+  status = pthread_kill( ThreadId, SIGUSR1 );
+  rtems_test_assert( !status );
+
+  sleep( 2 );
+
+     /* let TestThread run */
+
+  puts( "Init: pthread_kill - SIGUSR to Test Thread - OK" );
+  status = pthread_kill( ThreadId, SIGUSR1 );
+  rtems_test_assert( !status );
+
+  sleep( 1 );
+
+     /* let TestThread run */
+
+
+
+  puts( "*** END OF POSIX TEST SIGNAL 06 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS             2
+#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 2
+#define CONFIGURE_MAXIMUM_POSIX_MUTEXES             1
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+#include <rtems/confdefs.h>
+/* end of file */
Index: testsuites/psxtests/psxsignal06/psxsignal06.scn
===================================================================
--- testsuites/psxtests/psxsignal06/psxsignal06.scn	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
+++ testsuites/psxtests/psxsignal06/psxsignal06.scn	(revision 4fcd106dd4e09e4142ee0bc9eef0998215a114f1)
@@ -0,0 +1,11 @@
+*** POSIX TEST SIGNAL 06 ***
+Init: pthread_cond_init - OK
+Init: pthread_mutex_init - OK
+Init: pthread_create - OK
+Test: Unblock SIGUSR1
+Test: pthread_cond_wait - OK
+Init: pthread_kill - SIGUSR to Test Thread - OK
+Test: pthread_cond_wait - interrupted by signal
+Init: pthread_kill - SIGUSR to Test Thread - OK
+Test: seconds left=8
+*** END OF POSIX TEST SIGNAL 06 ***
