[rtems commit] rtems: Use correct sync state for system events

Sebastian Huber sebh at rtems.org
Wed Oct 31 16:00:03 UTC 2012


Module:    rtems
Branch:    master
Commit:    736b8d27147f1c8e269353267e9c61b7df724119
Changeset: http://git.rtems.org/rtems/commit/?id=736b8d27147f1c8e269353267e9c61b7df724119

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Oct 31 17:02:28 2012 +0100

rtems: Use correct sync state for system events

---

 cpukit/rtems/include/rtems/rtems/event.h |    2 +-
 cpukit/rtems/src/eventseize.c            |    2 +-
 cpukit/rtems/src/eventtimeout.c          |   37 ++++++++---------------------
 3 files changed, 12 insertions(+), 29 deletions(-)

diff --git a/cpukit/rtems/include/rtems/rtems/event.h b/cpukit/rtems/include/rtems/rtems/event.h
index b8d9987..349add5 100644
--- a/cpukit/rtems/include/rtems/rtems/event.h
+++ b/cpukit/rtems/include/rtems/rtems/event.h
@@ -448,7 +448,7 @@ void _Event_Surrender(
 
 void _Event_Timeout(
   Objects_Id  id,
-  void       *ignored
+  void       *arg
 );
 
 RTEMS_EVENT_EXTERN Thread_blocking_operation_States _Event_Sync_state;
diff --git a/cpukit/rtems/src/eventseize.c b/cpukit/rtems/src/eventseize.c
index 175639f..c88f3f7 100644
--- a/cpukit/rtems/src/eventseize.c
+++ b/cpukit/rtems/src/eventseize.c
@@ -81,7 +81,7 @@ void _Event_Seize(
       &executing->Timer,
       _Event_Timeout,
       executing->Object.id,
-      NULL
+      sync_state
     );
     _Watchdog_Insert_ticks( &executing->Timer, ticks );
   }
diff --git a/cpukit/rtems/src/eventtimeout.c b/cpukit/rtems/src/eventtimeout.c
index eb0f84e..6e81a80 100644
--- a/cpukit/rtems/src/eventtimeout.c
+++ b/cpukit/rtems/src/eventtimeout.c
@@ -10,39 +10,22 @@
  */
 
 #if HAVE_CONFIG_H
-#include "config.h"
+  #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
 #include <rtems/rtems/event.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/options.h>
-#include <rtems/score/states.h>
-#include <rtems/score/thread.h>
-#include <rtems/rtems/tasks.h>
-
-/*
- *  _Event_Timeout
- *
- *  This routine processes a thread which timeouts while waiting to
- *  receive an event_set. It is called by the watchdog handler.
- *
- *  Input parameters:
- *    id - thread id
- *
- *  Output parameters: NONE
- */
 
 void _Event_Timeout(
   Objects_Id  id,
-  void       *ignored
+  void       *arg
 )
 {
-  Thread_Control    *the_thread;
-  Objects_Locations  location;
-  ISR_Level          level;
+  Thread_Control                   *the_thread;
+  Objects_Locations                 location;
+  ISR_Level                         level;
+  Thread_blocking_operation_States *sync_state;
+
+  sync_state = arg;
 
   the_thread = _Thread_Get( id, &location );
   switch ( location ) {
@@ -71,8 +54,8 @@ void _Event_Timeout(
 
         the_thread->Wait.count = 0;
         if ( _Thread_Is_executing( the_thread ) ) {
-          if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
-            _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
+          if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
+            *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
         }
 
         the_thread->Wait.return_code = RTEMS_TIMEOUT;




More information about the vc mailing list