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:
James E. Blair 2015-01-08 08:37:50 -08:00
parent 4c703c928f
commit 6de3cdd29b
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}