Timer Server and Blocking Calls

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 10 12:19:01 UTC 2009


Hi,

is it allowed that a function executed within the timer server context blocks
while acquiring a resource?

If it is allowed then the timer server has a bug.  The clock tick readies the
timer server via a _Thread_Unblock() which does not take into account that the
timer server may block due to something other than a delay.  This may fix it:

Index: cpukit/score/src/threaddelayended.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/score/src/threaddelayended.c,v
retrieving revision 1.6
diff -u -r1.6 threaddelayended.c
--- cpukit/score/src/threaddelayended.c 31 Dec 2008 03:36:04 -0000      1.6
+++ cpukit/score/src/threaddelayended.c 10 Nov 2009 12:06:49 -0000
@@ -59,7 +59,7 @@
 #endif
       break;
     case OBJECTS_LOCAL:
-      _Thread_Unblock( the_thread );
+      _Thread_Clear_state( the_thread, STATES_DELAYING );
       _Thread_Unnest_dispatch();
       break;
   }

I do not know how this affects rtems_task_wake_when() and the
STATES_WAITING_FOR_TIME state.  What is the difference between
STATES_WAITING_FOR_TIME and STATES_DELAYING?

Have a nice day!

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list