products/CPSUid

changeset 20:469391ff4449

adding comment
author atchertchian
date Fri, 11 Aug 2006 12:21:10 +0000
parents b619c4219090
children 4c518c58ad6b
files uidcounter.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/uidcounter.py
     1.2 +++ b/uidcounter.py
     1.3 @@ -75,6 +75,7 @@
     1.4      def hit(self):
     1.5          """Hit the counter: return current counter and increment its value
     1.6          """
     1.7 +        # XXX AT: this is were conflict issues should be handled (?)
     1.8          counter_value = self.counter_current
     1.9          self.counter_current = counter_value + 1
    1.10          return counter_value
    1.11 @@ -104,9 +105,8 @@
    1.12      def _p_resolveConflict(self, oldState, savedState, newState):
    1.13          """Avoid conflicts when changing the counter value
    1.14          """
    1.15 -        #XXX GR: this does resolve conflicts, but the two callers got
    1.16 -        # the same number, hence really need to randomize the uid to enforce
    1.17 -        # unicity
    1.18 +        # XXX GR: this does resolve conflicts, but the two callers got the same
    1.19 +        # number, hence really need to randomize the uid to enforce unicity
    1.20          bigger_counter = max(savedState['counter_current'],
    1.21                               newState['counter_current'])
    1.22          newState['counter_current'] = bigger_counter + 1