Once commute has been called on a Ref (within a transaction of
course), ref-set and alter cannot be called on it within the same
transaction.
This is enforced by the following code from the doSet method in
LockingTransaction.java.

       if(commutes.containsKey(ref))
            throw new IllegalStateException("Can't set after commute");

Given that, I'm trying to figure out why the run method in
LockingTransaction.java contains this code in the loop that is
responsible for calling all the commute functions a second time during
the commit.

                    for(Map.Entry<Ref, ArrayList<CFn>> e : commutes.entrySet())
                    {
                        Ref ref = e.getKey();
                        if(sets.contains(ref)) continue;
                        ...

It seems that the Ref can't be in the sets HashSet if commute was
called first on the Ref.
Maybe it's there in case ref-set or alter was called on the Ref before commute.
In that case, does that mean that the commute functions for that Ref
won't be called a second time during the commit?

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to