BUG-1786: fixup DeadlockDetectingListeningExecutorService 84/10984/3
authorRobert Varga <rovarga@cisco.com>
Wed, 10 Sep 2014 09:55:02 +0000 (11:55 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 10 Sep 2014 15:04:29 +0000 (17:04 +0200)
commite2c0a2ad1e3db5463881e3ffea285f4e33a7b216
treeaecb71d59921c64c2399133892db9bb8ecbdcabc
parentb241ae747e7ace77045495ff251a2dfb4f95f454
BUG-1786: fixup DeadlockDetectingListeningExecutorService

This patch deprecates the use of a Function where a Supplier should be
used.

Furthermore it shifts the balance of the ThreadLocal interaction by
retaining switching a Boolean to a SettableBoolean and flipping the
field contained within it rather than setting/removing the thread local
value itself. This can leave a single object attached to a thread --
which can be removed by a call to cleanStateForCurrentThread(), but
improves the performance of the fast path by utilizing the
ThreadLocal.get() fastpath when used with threadpools.

Change-Id: I2d8897138f8719187425e3aa8121bdc0f1ff39b2
Signed-off-by: Robert Varga <rovarga@cisco.com>
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/DeadlockDetectingListeningExecutorService.java
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/SettableBoolean.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/SettableBooleanThreadLocal.java [new file with mode: 0644]