Ignoring exchanger critical section begin/end if called from illegal thread. - Fixes
@@ -2348,8 +2348,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
* Should be called from exchange worker thread.
*/
public void exchangerBlockingSectionBegin() {
- assert exchWorker != null && Thread.currentThread() == exchWorker.runner();
-
+ if (currentThreadIsExchanger())
exchWorker.blockingSectionBegin();
}
@@ -2358,11 +2357,15 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
* Should be called from exchange worker thread.
*/
public void exchangerBlockingSectionEnd() {
- assert exchWorker != null && Thread.currentThread() == exchWorker.runner();
-
+ if (currentThreadIsExchanger())
exchWorker.blockingSectionEnd();
}
+ /** */
+ private boolean currentThreadIsExchanger() {
+ return exchWorker != null && Thread.currentThread() == exchWorker.runner();
+ }
+
/**
* @return {@code True} If there is any exchange future in progress.
*/
