Fixed issue NETTY-50 (Dead lock in MemoryAwareThreadPoolExecutor)
* Made sure that the max memory size properties become immutable
This commit is contained in:
parent
50f043fa3e
commit
6f18c940dd
@ -197,6 +197,12 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
throw new IllegalArgumentException(
|
||||
"maxChannelMemorySize: " + maxChannelMemorySize);
|
||||
}
|
||||
|
||||
if (getTaskCount() > 0) {
|
||||
throw new IllegalStateException(
|
||||
"can't be changed after a task is executed");
|
||||
}
|
||||
|
||||
settings = new Settings(maxChannelMemorySize, settings.maxTotalMemorySize);
|
||||
}
|
||||
|
||||
@ -216,6 +222,12 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
throw new IllegalArgumentException(
|
||||
"maxTotalMemorySize: " + maxTotalMemorySize);
|
||||
}
|
||||
|
||||
if (getTaskCount() > 0) {
|
||||
throw new IllegalStateException(
|
||||
"can't be changed after a task is executed");
|
||||
}
|
||||
|
||||
settings = new Settings(settings.maxChannelMemorySize, maxTotalMemorySize);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user