Protect against partially initialized executer workers
The registerJobs method of an executorworker can be invoked by an external caller before the worker is completely initialized by its run method. We protected against that by checking one instance variable, but there's still a race condition involving another. Add a check for that variable as well. Change-Id: I8e2cfffb54aa8a4cf8b1e61e9a9184b091054462
This commit is contained in:
parent
4c703c928f
commit
6de3cdd29b
|
@ -107,7 +107,7 @@ public class ExecutorWorkerThread extends AbstractWorkerThread{
|
|||
*/
|
||||
@Override
|
||||
public void registerJobs() {
|
||||
if (worker == null) {
|
||||
if (worker == null || functionMap == null) {
|
||||
// We haven't been initialized yet; the run method will call this again
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue