ENH: Rename mutex variables

Mutex variables should match the variables that they protect.

Change-Id: I3d3395cdc222b91f94a62d98a57dd78d37abb3dd
ENH: Add class for ThreadStructs

Improve readabiltiy of code by using a small lightweight
class instead of the std::pair.

Change-Id: I33e4339e9404df29bb2b73220cf70c91ffc61590
ENH: Imporeve names of sentinal flags

Values used to indicates non-running job status are now using enumeration
to make code easier to read.

Change-Id: I31449d869939c18d391b5dc6426a40943ae46fc1
ENH: More naming cleanups of the ThreadStructs.

Change-Id: I85eb58659762656cb06949d9a390fde04d5ab5e8
ENH: Cleanups and comments added.

Change-Id: I42f4525f1e6389e279a3beb87e04899d7f52071d
ENH: Improve variable names.

Change-Id: Ic2eac086c8ab242cb1c24eb25795ca4d2cfa7f1a