Skip to contentSkip to conversation

Fix locking on interation restart

PATCH Jan Kiszka 1 participant 1 message Jun 3, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Argh, someone very blind must have contributed this bug - of course /me.

This is also stuff or 2.3 (just like the 1/2 patch).

Jan

---
 ChangeLog             |    3 +++
 ksrc/nucleus/module.c |    7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
ChangeLog +3 -0
Index: xenomai/ChangeLog
===================================================================
@@ -9,6 +9,9 @@
 	* ksrc/nucleus/synch.c (xnsynch_sleep_on): Fix timeout restart
 	if resource was robbed.
 
+	* ksrc/nucleus/module.c: Fix locking on restart of sched and stat
+	interation for proc output.
+
 2007-06-02  Philippe Gerum  <[email protected]>
 
 	* ksrc/skins/psos+, src/skins/psos+, include/psos+/psos.h: Add
ksrc/nucleus/module.c +4 -3
Index: xenomai/ksrc/nucleus/module.c
===================================================================
@@ -190,9 +190,9 @@ static int sched_seq_open(struct inode *
 	if (!nkpod)
 		return -ESRCH;
 
-      restart:
 	xnlock_get_irqsave(&nklock, s);
 
+      restart:
 	rev = nkpod->threadq_rev;
 	count = countq(&nkpod->threadq);	/* Cannot be empty (ROOT) */
 	holder = getheadq(&nkpod->threadq);
@@ -363,9 +363,10 @@ static int stat_seq_open(struct inode *i
 	if (!nkpod)
 		return -ESRCH;
 
-      restart:
+      restart_unlocked:
 	xnlock_get_irqsave(&nklock, s);
 
+      restart:
 	count = countq(&nkpod->threadq);	/* Cannot be empty (ROOT) */
 	holder = getheadq(&nkpod->threadq);
 	thrq_rev = nkpod->threadq_rev;
@@ -461,7 +462,7 @@ static int stat_seq_open(struct inode *i
 					   &stat_info->runtime,
 					   &stat_info->account_period);
 			if (err == -EAGAIN)
-				goto restart;
+				goto restart_unlocked;
 			if (err)
 				break; /* line unused or end of chain */