Browse Source

Improved retrieval of unique active object for reader-writer-locks

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7351 8c9fc860-2736-0410-a75d-ab315db34111
negelef 8 years ago
parent
commit
009c280187
1 changed files with 4 additions and 2 deletions
  1. 4 2
      source/Coop.Objects.Mod

+ 4 - 2
source/Coop.Objects.Mod

@@ -226,8 +226,10 @@ END GetStackBottom;
 
 
 (** Return the active object currently executing. *)
 (** Return the active object currently executing. *)
 PROCEDURE ActiveObject* (): ANY;
 PROCEDURE ActiveObject* (): ANY;
-BEGIN
-	RETURN Activities.GetCurrentActivity ().object;
+VAR activity {UNTRACED}: Activities.Activity;
+BEGIN {UNCOOPERATIVE, UNCHECKED}
+	activity := Activities.GetCurrentActivity ();
+	IF activity.object # NIL THEN RETURN activity.object ELSE RETURN activity END;
 END ActiveObject;
 END ActiveObject;
 
 
 (** Return the ID of the active currently executing process. *)
 (** Return the ID of the active currently executing process. *)