<!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-08-04)</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-08-04 Ricardo Aguirre <el.mastin@ymail.com>

        PR 1887/tests
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
        pthread_rwlock_unlock - thread waiting, no preempt.
        * psxtmrwlock06/.cvsignore, psxtmrwlock06/Makefile.am,
        psxtmrwlock06/init.c, psxtmrwlock06/psxtmrwlock06.doc: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/ChangeLog.diff?r1=text&tr1=1.44&r2=text&tr2=1.45&diff_format=h">M</a></td><td width='1%'>1.45</td><td width='100%'>testsuites/psxtmtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/Makefile.am.diff?r1=text&tr1=1.25&r2=text&tr2=1.26&diff_format=h">M</a></td><td width='1%'>1.26</td><td width='100%'>testsuites/psxtmtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/configure.ac.diff?r1=text&tr1=1.28&r2=text&tr2=1.29&diff_format=h">M</a></td><td width='1%'>1.29</td><td width='100%'>testsuites/psxtmtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock06/.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/psxtmtests/psxtmrwlock06/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock06/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/psxtmtests/psxtmrwlock06/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock06/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/psxtmtests/psxtmrwlock06/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock06/psxtmrwlock06.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/psxtmtests/psxtmrwlock06/psxtmrwlock06.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmtests_plan.csv.diff?r1=text&tr1=1.27&r2=text&tr2=1.28&diff_format=h">M</a></td><td width='1%'>1.28</td><td width='100%'>testsuites/psxtmtests/psxtmtests_plan.csv</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/ChangeLog:1.44 rtems/testsuites/psxtmtests/ChangeLog:1.45
--- rtems/testsuites/psxtmtests/ChangeLog:1.44  Thu Aug  4 10:06:45 2011
+++ rtems/testsuites/psxtmtests/ChangeLog       Thu Aug  4 10:15:23 2011
</font><font color='#997700'>@@ -1,5 +1,13 @@
</font> 2011-08-04        Ricardo Aguirre <el.mastin@ymail.com>
 
<font color='#000088'>+   PR 1887/tests
+       * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
+       pthread_rwlock_unlock - thread waiting, no preempt.
+       * psxtmrwlock06/.cvsignore, psxtmrwlock06/Makefile.am,
+       psxtmrwlock06/init.c, psxtmrwlock06/psxtmrwlock06.doc: New files.
+
+2011-08-04     Ricardo Aguirre <el.mastin@ymail.com>
+
</font>   * psxtmrwlock01/init.c, psxtmrwlock01/psxtmrwlock01.doc: Update.
 
 2011-08-04     Ricardo Aguirre <el.mastin@ymail.com>

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/Makefile.am:1.25 rtems/testsuites/psxtmtests/Makefile.am:1.26
--- rtems/testsuites/psxtmtests/Makefile.am:1.25        Thu Aug  4 10:02:06 2011
+++ rtems/testsuites/psxtmtests/Makefile.am     Thu Aug  4 10:15:23 2011
</font><font color='#997700'>@@ -26,6 +26,7 @@
</font> SUBDIRS += psxtmrwlock03
 SUBDIRS += psxtmrwlock04
 SUBDIRS += psxtmrwlock05
<font color='#000088'>+SUBDIRS += psxtmrwlock06
</font> SUBDIRS += psxtmsem01
 SUBDIRS += psxtmsem02
 SUBDIRS += psxtmsem03

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/configure.ac:1.28 rtems/testsuites/psxtmtests/configure.ac:1.29
--- rtems/testsuites/psxtmtests/configure.ac:1.28       Thu Aug  4 10:02:06 2011
+++ rtems/testsuites/psxtmtests/configure.ac    Thu Aug  4 10:15:23 2011
</font><font color='#997700'>@@ -98,6 +98,7 @@
</font> psxtmrwlock03/Makefile
 psxtmrwlock04/Makefile
 psxtmrwlock05/Makefile
<font color='#000088'>+psxtmrwlock06/Makefile
</font> psxtmsem01/Makefile
 psxtmsem02/Makefile
 psxtmsem03/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmrwlock06/.cvsignore:1.1
--- /dev/null   Thu Aug  4 11:10:48 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock06/.cvsignore        Thu Aug  4 10:15:23 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/psxtmtests/psxtmrwlock06/Makefile.am:1.1
--- /dev/null   Thu Aug  4 11:10:49 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock06/Makefile.am       Thu Aug  4 10:15:23 2011
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmrwlock06
+psxtmrwlock06_SOURCES = init.c ../../tmtests/include/timesys.h \
+    ../../support/src/tmtests_empty_function.c \
+    ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmrwlock06.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+OPERATION_COUNT = @OPERATION_COUNT@
+AM_CPPFLAGS += -I$(top_srcdir)/../tmtests/include
+AM_CPPFLAGS += -DOPERATION_COUNT=$(OPERATION_COUNT)
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxtmrwlock06_OBJECTS) $(psxtmrwlock06_LDADD)
+LINK_LIBS = $(psxtmrwlock06_LDLIBS)
+
+psxtmrwlock06$(EXEEXT): $(psxtmrwlock06_OBJECTS) $(psxtmrwlock06_DEPENDENCIES)
+       @rm -f psxtmrwlock06$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmrwlock06/init.c:1.1
--- /dev/null   Thu Aug  4 11:10:49 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock06/init.c    Thu Aug  4 10:15:23 2011
</font><font color='#997700'>@@ -0,0 +1,106 @@
</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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <coverhd.h>
+#include <pthread.h>
+#include <sched.h>
+#include <tmacros.h>
+#include <timesys.h>
+#include "test_support.h"
+#include <rtems/timerdrv.h>
+
+pthread_rwlock_t     rwlock;
+
+void *Blocker(
+  void *argument
+)
+{
+  (void) pthread_rwlock_wrlock(&rwlock);
+  /* should never return */
+  rtems_test_assert( FALSE );
+
+  return NULL;
+}
+
+void *POSIX_Init(
+  void *argument
+)
+{
+  int                   status;
+  pthread_t             threadId;
+  long                  end_time;
+  pthread_rwlockattr_t  attr;
+
+  puts( "\n\n*** POSIX TIME TEST PSXTMRWLOCK 06 ***" );
+
+  status = pthread_create( &threadId, NULL, Blocker, NULL );
+  rtems_test_assert( status == 0 );
+  /*
+   * Deliberately create the rwlock after the threads.  This way if the
+   * threads do run before we intend, they will get an error.
+   */
+
+  /* creating rwlock */
+    status = pthread_rwlockattr_init( &attr );
+  rtems_test_assert( status == 0 );
+  status = pthread_rwlock_init( &rwlock, &attr );
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Ensure the rwlock is unavailable so the other threads block.
+   */
+  /* lock rwlock to ensure thread blocks */
+  status = pthread_rwlock_wrlock(&rwlock);
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Let the other thread start so the thread startup overhead,
+   * is accounted for.  When we return, we can start the benchmark.
+   */
+  sched_yield();
+    /* let other thread run */
+
+  benchmark_timer_initialize();
+    status = pthread_rwlock_unlock(&rwlock); /*  unlock the rwlock */
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status == 0 );
+
+  put_time(
+    "pthread_rwlock_unlock - thread waiting, no preempt",
+    end_time,
+    1,
+    0,
+    0
+  );
+
+  puts( "*** END OF POSIX TIME TEST PSXTMRWLOCK 06 ***" );
+  rtems_test_exit( 0 );
+
+  return NULL;
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS     2
+#define CONFIGURE_MAXIMUM_POSIX_RWLOCKS     1
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+  /* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmrwlock06/psxtmrwlock06.doc:1.1
--- /dev/null   Thu Aug  4 11:10:49 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock06/psxtmrwlock06.doc Thu Aug  4 10:15:23 2011
</font><font color='#997700'>@@ -0,0 +1,14 @@
</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 test benchmarks the following operations:
+
++ pthread_rwlock_unlock - thread waiting, no preempt
</font>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.27 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.28
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.27        Thu Aug  4 10:02:06 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv     Thu Aug  4 10:15:23 2011
</font><font color='#997700'>@@ -72,7 +72,7 @@
</font> "pthread_rwlock_timedrdlock - available","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_timedrdlock - not available, blocks","psxtmrwlock03","psxtmtest_blocking","Yes"
 "pthread_rwlock_unlock - no threads waiting","psxtmrwlock01","psxtmtest_single","Yes"
<font color='#880000'>-"pthread_rwlock_unlock - thread waiting, no preempt",,,
</font><font color='#000088'>+"pthread_rwlock_unlock - thread waiting, no preempt","psxtmrwlock06",,"Yes"
</font> "pthread_rwlock_unlock - thread waiting, preempt",,,
 "pthread_rwlock_wrlock - available","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_wrlock - not available, blocks","psxtmwrlock04","psxtmtest_blocking","Yes"
</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>2011-08-04 Ricardo Aguirre <el.mastin@ymail.com>

        PR 1888/tests
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
        pthread_rwlock_unlock - thread waiting, preempt.
        * psxtmrwlock07/.cvsignore, psxtmrwlock07/Makefile.am,
        psxtmrwlock07/init.c, psxtmrwlock07/psxtmrwlock07.doc: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/ChangeLog.diff?r1=text&tr1=1.45&r2=text&tr2=1.46&diff_format=h">M</a></td><td width='1%'>1.46</td><td width='100%'>testsuites/psxtmtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/Makefile.am.diff?r1=text&tr1=1.26&r2=text&tr2=1.27&diff_format=h">M</a></td><td width='1%'>1.27</td><td width='100%'>testsuites/psxtmtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/configure.ac.diff?r1=text&tr1=1.29&r2=text&tr2=1.30&diff_format=h">M</a></td><td width='1%'>1.30</td><td width='100%'>testsuites/psxtmtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock07/.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/psxtmtests/psxtmrwlock07/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock07/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/psxtmtests/psxtmrwlock07/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock07/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/psxtmtests/psxtmrwlock07/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmrwlock07/psxtmrwlock07.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/psxtmtests/psxtmrwlock07/psxtmrwlock07.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmtests_plan.csv.diff?r1=text&tr1=1.28&r2=text&tr2=1.29&diff_format=h">M</a></td><td width='1%'>1.29</td><td width='100%'>testsuites/psxtmtests/psxtmtests_plan.csv</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/ChangeLog:1.45 rtems/testsuites/psxtmtests/ChangeLog:1.46
--- rtems/testsuites/psxtmtests/ChangeLog:1.45  Thu Aug  4 10:15:23 2011
+++ rtems/testsuites/psxtmtests/ChangeLog       Thu Aug  4 10:20:06 2011
</font><font color='#997700'>@@ -1,5 +1,13 @@
</font> 2011-08-04        Ricardo Aguirre <el.mastin@ymail.com>
 
<font color='#000088'>+   PR 1888/tests
+       * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
+       pthread_rwlock_unlock - thread waiting, preempt.
+       * psxtmrwlock07/.cvsignore, psxtmrwlock07/Makefile.am,
+       psxtmrwlock07/init.c, psxtmrwlock07/psxtmrwlock07.doc: New files.
+
+2011-08-04     Ricardo Aguirre <el.mastin@ymail.com>
+
</font>   PR 1887/tests
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
        pthread_rwlock_unlock - thread waiting, no preempt.

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/Makefile.am:1.26 rtems/testsuites/psxtmtests/Makefile.am:1.27
--- rtems/testsuites/psxtmtests/Makefile.am:1.26        Thu Aug  4 10:15:23 2011
+++ rtems/testsuites/psxtmtests/Makefile.am     Thu Aug  4 10:20:06 2011
</font><font color='#997700'>@@ -27,6 +27,7 @@
</font> SUBDIRS += psxtmrwlock04
 SUBDIRS += psxtmrwlock05
 SUBDIRS += psxtmrwlock06
<font color='#000088'>+SUBDIRS += psxtmrwlock07
</font> SUBDIRS += psxtmsem01
 SUBDIRS += psxtmsem02
 SUBDIRS += psxtmsem03

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/configure.ac:1.29 rtems/testsuites/psxtmtests/configure.ac:1.30
--- rtems/testsuites/psxtmtests/configure.ac:1.29       Thu Aug  4 10:15:23 2011
+++ rtems/testsuites/psxtmtests/configure.ac    Thu Aug  4 10:20:06 2011
</font><font color='#997700'>@@ -99,6 +99,7 @@
</font> psxtmrwlock04/Makefile
 psxtmrwlock05/Makefile
 psxtmrwlock06/Makefile
<font color='#000088'>+psxtmrwlock07/Makefile
</font> psxtmsem01/Makefile
 psxtmsem02/Makefile
 psxtmsem03/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmrwlock07/.cvsignore:1.1
--- /dev/null   Thu Aug  4 11:10:49 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock07/.cvsignore        Thu Aug  4 10:20:06 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/psxtmtests/psxtmrwlock07/Makefile.am:1.1
--- /dev/null   Thu Aug  4 11:10:49 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock07/Makefile.am       Thu Aug  4 10:20:06 2011
</font><font color='#997700'>@@ -0,0 +1,31 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmrwlock07
+psxtmrwlock07_SOURCES  = init.c
+psxtmrwlock07_SOURCES += ../../tmtests/include/timesys.h
+psxtmrwlock07_SOURCES += ../../support/src/tmtests_empty_function.c
+psxtmrwlock07_SOURCES += ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmrwlock07.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+OPERATION_COUNT = @OPERATION_COUNT@
+AM_CPPFLAGS += -I$(top_srcdir)/../tmtests/include
+AM_CPPFLAGS += -DOPERATION_COUNT=$(OPERATION_COUNT)
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxtmrwlock07_OBJECTS) $(psxtmrwlock07_LDADD)
+LINK_LIBS = $(psxtmrwlock07_LDLIBS)
+
+psxtmrwlock07$(EXEEXT): $(psxtmrwlock07_OBJECTS) $(psxtmrwlock07_DEPENDENCIES)
+       @rm -f psxtmrwlock07$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmrwlock07/init.c:1.1
--- /dev/null   Thu Aug  4 11:10:49 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock07/init.c    Thu Aug  4 10:20:06 2011
</font><font color='#997700'>@@ -0,0 +1,162 @@
</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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <coverhd.h>
+#include <tmacros.h>
+#include <timesys.h>
+#include "test_support.h"
+#include <pthread.h>
+#include <sched.h>
+#include <rtems/timerdrv.h>
+
+pthread_rwlock_t     rwlock;
+
+void *Low(
+  void *argument
+)
+{
+  int      status;
+  uint32_t end_time;
+
+  /* write locking */
+    status = pthread_rwlock_wrlock(&rwlock);
+  end_time = benchmark_timer_read();
+
+  rtems_test_assert( status == 0 );
+
+  put_time(
+    "pthread_rwlock_unlock - thread waiting, preempt",
+    end_time,
+    OPERATION_COUNT,
+    0,
+    0
+  );
+
+  puts( "*** END OF POSIX TIME TEST PSXTMRWLOCK 07 ***" );
+  rtems_test_exit( 0 );
+  return NULL;
+}
+
+void *Middle(
+  void *argument
+)
+{
+  int status;
+
+  /* write locking */
+  status =  pthread_rwlock_wrlock(&rwlock);
+  rtems_test_assert( status == 0 );
+
+    /* thread switch occurs */
+
+    status = pthread_rwlock_unlock(&rwlock); /*  unlock the rwlock */
+  rtems_test_assert( status == 0 );
+    /* thread switch occurs */
+
+  /* should never return */
+  rtems_test_assert( FALSE );
+  return NULL;
+}
+
+void *POSIX_Init(
+  void *argument
+)
+{
+  int                 i;
+  int                 status;
+  pthread_t           threadId;
+  pthread_attr_t      attr;
+  struct sched_param  param;
+  pthread_rwlockattr_t rw_attr;
+
+  puts( "\n\n*** POSIX TIME TEST PSXTMRWLOCK 07 ***" );
+
+  /*
+   * Deliberately create the lock BEFORE the threads.  This way the
+   * threads should preempt this thread and block as they are created.
+   */
+  status = pthread_rwlockattr_init( &rw_attr );
+  rtems_test_assert( status == 0 );
+  status = pthread_rwlock_init( &rwlock, &rw_attr );
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Obtain the lock so the threads will block.
+   */
+  status = pthread_rwlock_wrlock(&rwlock);
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Now lower our priority
+   */
+  status = pthread_attr_init( &attr );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_attr_setschedpolicy( &attr, SCHED_RR );
+  rtems_test_assert( status == 0 );
+
+  param.sched_priority = 2;
+  status = pthread_attr_setschedparam( &attr, &param );
+  rtems_test_assert( status == 0 );
+
+  /*
+   * And create rest of threads as more important than we are.  They
+   * will preempt us as they are created and block.
+   */
+  for ( i=0 ; i < OPERATION_COUNT ; i++ ) {
+
+    param.sched_priority = 3 + i;
+    status = pthread_attr_setschedparam( &attr, &param );
+    rtems_test_assert( status == 0 );
+
+    status = pthread_create(
+      &threadId,
+      &attr,
+      (i == OPERATION_COUNT - 1) ? Low : Middle,
+      NULL
+    );
+    rtems_test_assert( status == 0 );
+  }
+
+  /*
+   * Now start the timer which will be stopped in Low
+   * Release the lock.  Threads unblock and preempt.
+   */
+  benchmark_timer_initialize();
+
+    status = pthread_rwlock_unlock(&rwlock);
+      /* thread switch occurs */
+
+  /* should never return */
+  rtems_test_assert( FALSE );
+  return NULL;
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS     OPERATION_COUNT + 2
+#define CONFIGURE_MAXIMUM_POSIX_RWLOCKS     1
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmrwlock07/psxtmrwlock07.doc:1.1
--- /dev/null   Thu Aug  4 11:10:49 2011
+++ rtems/testsuites/psxtmtests/psxtmrwlock07/psxtmrwlock07.doc Thu Aug  4 10:20:06 2011
</font><font color='#997700'>@@ -0,0 +1,14 @@
</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 test benchmarks the following operations:
+
++ pthread_rwlock_unlock - thread waiting, preempt
</font>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.28 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.29
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.28        Thu Aug  4 10:15:23 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv     Thu Aug  4 10:20:06 2011
</font><font color='#997700'>@@ -68,16 +68,16 @@
</font> "pthread_rwlock_rdlock - available","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_rdlock - not available, blocks","psxtmrwlock02","psxtmtest_blocking","Yes"
 "pthread_rwlock_tryrdlock - available","psxtmrwlock01","psxtmtest_single","Yes"
<font color='#880000'>-"pthread_rwlock_tryrdlock - not available",,"psxtmtest_single",
</font><font color='#000088'>+"pthread_rwlock_tryrdlock - not available","psxtmrwlock01","psxtmtest_single","Yes"
</font> "pthread_rwlock_timedrdlock - available","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_timedrdlock - not available, blocks","psxtmrwlock03","psxtmtest_blocking","Yes"
 "pthread_rwlock_unlock - no threads waiting","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_unlock - thread waiting, no preempt","psxtmrwlock06",,"Yes"
<font color='#880000'>-"pthread_rwlock_unlock - thread waiting, preempt",,,
</font><font color='#000088'>+"pthread_rwlock_unlock - thread waiting, preempt","psxtmrwlock07",,"Yes"
</font> "pthread_rwlock_wrlock - available","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_wrlock - not available, blocks","psxtmwrlock04","psxtmtest_blocking","Yes"
 "pthread_rwlock_trywrlock - available","psxtmrwlock01","psxtmtest_single","Yes"
<font color='#880000'>-"pthread_rwlock_trywrlock - not available",,"psxtmtest_single",
</font><font color='#000088'>+"pthread_rwlock_trywrlock - not available","psxtmrwlock01","psxtmtest_single","Yes"
</font> "pthread_rwlock_timedwrlock - available","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_timedwrlock - not available, blocks","psxtmrwlock05","psxtmtest_blocking","Yes"
 ,,,
</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>