renamed (add|remove)_synchronized_handler as (add|remove)_synchronization

This commit is contained in:
Jocelyn Fiat
2012-02-15 11:07:12 +01:00
parent 72cc05532c
commit 9138ffedfb
2 changed files with 19 additions and 19 deletions

View File

@@ -63,7 +63,7 @@ feature -- Events
feature -- Synchronization feature -- Synchronization
add_synchronized_handler (h: ERROR_HANDLER) add_synchronization (h: ERROR_HANDLER)
-- Add synchronization between `h' and `Current' -- Add synchronization between `h' and `Current'
--| the same handler can be added more than once --| the same handler can be added more than once
--| it will be synchronized only once --| it will be synchronized only once
@@ -80,18 +80,18 @@ feature -- Synchronization
check attached h.synchronized_handlers as h_lst and then h_lst.has (Current) end check attached h.synchronized_handlers as h_lst and then h_lst.has (Current) end
else else
lst.extend (h) lst.extend (h)
h.add_synchronized_handler (Current) h.add_synchronization (Current)
end end
end end
remove_synchronized_handler (h: ERROR_HANDLER) remove_synchronization (h: ERROR_HANDLER)
-- Remove synchronization between `h' and `Current' -- Remove synchronization between `h' and `Current'
do do
if attached synchronized_handlers as lst and then not lst.is_empty then if attached synchronized_handlers as lst and then not lst.is_empty then
synchronized_handlers := Void synchronized_handlers := Void
lst.prune_all (h) lst.prune_all (h)
h.remove_synchronized_handler (Current) h.remove_synchronization (Current)
synchronized_handlers := lst synchronized_handlers := lst
if lst.is_empty then if lst.is_empty then
@@ -294,7 +294,7 @@ feature -- Element changes
across across
lst as c lst as c
loop loop
c.item.remove_synchronized_handler (Current) c.item.remove_synchronization (Current)
end end
end end
synchronized_handlers := Void synchronized_handlers := Void

View File

@@ -47,7 +47,7 @@ feature -- Test routines
do do
create h1.make create h1.make
create h2.make create h2.make
h1.add_synchronized_handler (h2) h1.add_synchronization (h2)
h1.add_custom_error (123, "abc", "abc error occurred") h1.add_custom_error (123, "abc", "abc error occurred")
h1.add_custom_error (456, "abc", "abc error occurred") h1.add_custom_error (456, "abc", "abc error occurred")
@@ -70,8 +70,8 @@ feature -- Test routines
create h2.make create h2.make
create h3.make create h3.make
h1.add_synchronized_handler (h2) h1.add_synchronization (h2)
h2.add_synchronized_handler (h3) h2.add_synchronization (h3)
h1.add_custom_error (123, "abc", "abc error occurred") h1.add_custom_error (123, "abc", "abc error occurred")
h1.add_custom_error (456, "abc", "abc error occurred") h1.add_custom_error (456, "abc", "abc error occurred")
@@ -94,9 +94,9 @@ feature -- Test routines
create h2.make create h2.make
create h3.make create h3.make
h1.add_synchronized_handler (h2) h1.add_synchronization (h2)
h2.add_synchronized_handler (h3) h2.add_synchronization (h3)
h3.add_synchronized_handler (h1) h3.add_synchronization (h1)
h1.add_custom_error (123, "abc", "abc error occurred") h1.add_custom_error (123, "abc", "abc error occurred")
h1.add_custom_error (456, "abc", "abc error occurred") h1.add_custom_error (456, "abc", "abc error occurred")
@@ -119,17 +119,17 @@ feature -- Test routines
create h2.make create h2.make
create h3.make create h3.make
h1.add_synchronized_handler (h2) h1.add_synchronization (h2)
h2.add_synchronized_handler (h3) h2.add_synchronization (h3)
h3.add_synchronized_handler (h1) h3.add_synchronization (h1)
h1.add_custom_error (123, "abc", "abc error occurred") h1.add_custom_error (123, "abc", "abc error occurred")
h1.add_custom_error (456, "def", "def error occurred") h1.add_custom_error (456, "def", "def error occurred")
assert ("has 2 errors", h1.count = 2 and h2.count = h1.count and h3.count = h2.count) assert ("has 2 errors", h1.count = 2 and h2.count = h1.count and h3.count = h2.count)
h2.remove_synchronized_handler (h3) h2.remove_synchronization (h3)
h2.remove_synchronized_handler (h1) h2.remove_synchronization (h1)
h1.add_custom_error (789, "ghi", "ghi error occurred") h1.add_custom_error (789, "ghi", "ghi error occurred")
assert ("correct count of errors", h1.count = 3 and h2.count = 2 and h3.count = h1.count) assert ("correct count of errors", h1.count = 3 and h2.count = 2 and h3.count = h1.count)
@@ -149,9 +149,9 @@ feature -- Test routines
create h2.make create h2.make
create h3.make create h3.make
h1.add_synchronized_handler (h2) h1.add_synchronization (h2)
h2.add_synchronized_handler (h3) h2.add_synchronization (h3)
h3.add_synchronized_handler (h1) h3.add_synchronization (h1)
h1.add_custom_error (123, "abc", "abc error occurred") h1.add_custom_error (123, "abc", "abc error occurred")
h1.add_custom_error (456, "def", "def error occurred") h1.add_custom_error (456, "def", "def error occurred")