change log for rtems (2010-07-28)
rtems-vc at rtems.org
rtems-vc at rtems.org
Wed Jul 28 21:10:35 UTC 2010
*joel*:
2010-07-28 Vinu Rajashekhar <vinutheraj at gmail.com>
* posix/src/condinit.c, posix/src/condwaitsupp.c,
posix/src/psignalunblockthread.c: Clean up some signal interruption
code.
M 1.2533 cpukit/ChangeLog
M 1.9 cpukit/posix/src/condinit.c
M 1.9 cpukit/posix/src/condwaitsupp.c
M 1.12 cpukit/posix/src/psignalunblockthread.c
diff -u rtems/cpukit/ChangeLog:1.2532 rtems/cpukit/ChangeLog:1.2533
--- rtems/cpukit/ChangeLog:1.2532 Tue Jul 27 16:22:52 2010
+++ rtems/cpukit/ChangeLog Wed Jul 28 15:39:37 2010
@@ -1,3 +1,9 @@
+2010-07-28 Vinu Rajashekhar <vinutheraj at gmail.com>
+
+ * posix/src/condinit.c, posix/src/condwaitsupp.c,
+ posix/src/psignalunblockthread.c: Clean up some signal interruption
+ code.
+
2010-07-27 Joel Sherrill <joel.sherrill at oarcorp.com>
* posix/src/keycreate.c: Fix typo.
diff -u rtems/cpukit/posix/src/condinit.c:1.8 rtems/cpukit/posix/src/condinit.c:1.9
--- rtems/cpukit/posix/src/condinit.c:1.8 Wed Jan 23 16:57:43 2008
+++ rtems/cpukit/posix/src/condinit.c Wed Jul 28 15:39:40 2010
@@ -44,7 +44,6 @@
/*
* Be careful about attributes when global!!!
*/
-
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
return EINVAL;
@@ -64,11 +63,10 @@
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
-/* XXX some more initialization might need to go here */
_Thread_queue_Initialize(
&the_cond->Wait_queue,
THREAD_QUEUE_DISCIPLINE_FIFO,
- STATES_WAITING_FOR_CONDITION_VARIABLE,
+ STATES_WAITING_FOR_CONDITION_VARIABLE | STATES_INTERRUPTIBLE_BY_SIGNAL,
ETIMEDOUT
);
diff -u rtems/cpukit/posix/src/condwaitsupp.c:1.8 rtems/cpukit/posix/src/condwaitsupp.c:1.9
--- rtems/cpukit/posix/src/condwaitsupp.c:1.8 Thu Sep 4 10:23:11 2008
+++ rtems/cpukit/posix/src/condwaitsupp.c Wed Jul 28 15:39:44 2010
@@ -85,9 +85,16 @@
* _Thread_queue_Enqueue.
*/
+ /*
+ * If the thread is interrupted, while in the thread queue, by
+ * a POSIX signal, then pthread_cond_wait returns spuriously,
+ * according to the POSIX standard. It means that pthread_cond_wait
+ * returns a success status, except for the fact that it was not
+ * woken up a pthread_cond_signal or a pthread_cond_broadcast.
+ */
status = _Thread_Executing->Wait.return_code;
- if ( status && status != ETIMEDOUT )
- return status;
+ if ( status == EINTR )
+ status = 0;
} else {
_Thread_Enable_dispatch();
diff -u rtems/cpukit/posix/src/psignalunblockthread.c:1.11 rtems/cpukit/posix/src/psignalunblockthread.c:1.12
--- rtems/cpukit/posix/src/psignalunblockthread.c:1.11 Mon Jun 28 19:34:11 2010
+++ rtems/cpukit/posix/src/psignalunblockthread.c Wed Jul 28 15:39:48 2010
@@ -101,21 +101,17 @@
if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) {
the_thread->Wait.return_code = EINTR;
/*
- * 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.
+ * In pthread_cond_wait, a thread will be blocking on a thread
+ * queue, but is also interruptible by a POSIX signal.
*/
- #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) ){
+ else 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 );
}
+
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Context_Switch_necessary = true;
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100728/61333e95/attachment.html>
More information about the vc
mailing list