DESCRIPTION

SPY-167: Avoid deadlock on notify listeners.

Motivation
----------
Because of how the addListener and notifyListener works, it could be that
one deadlocks each other because they are waiting on the same locks from
different threads.

Modifications
-------------
The listeners are copied before notified, moving it out of the synch block.

Result
------
Since notify is not synched anymore, the lock should be not happening anymore.

Note that also the listeners array is set to empty which avoid notifying listeners
more than once potentially.

Thanks xxx@xxx.xxx for pointing out the fix.

Change-Id: I7ebda58c2eadd62d8885e3eeac79d5a971e07979


COMMENTS

author: Natasha Sullivan
date: 2014-05-05 06:04:15.544000000

Patch Set 6: Commit message was updated

-------------------------------------
author: Jasmin Rangel
date: 2014-05-05 06:04:19.611000000

Patch Set 6:

New patchset patch-id matches previous patchset, but commit message has changed.

-------------------------------------
author: Andreas Short
date: 2014-05-05 15:00:23.811000000

Patch Set 6: Code-Review+2

-------------------------------------
author: Natasha Sullivan
date: 2014-05-05 15:13:31.372000000

Patch Set 7: Patch Set 6 was rebased

-------------------------------------
