controller:lib: Added preprocessor definitions for windows build.
controller:lib: Fixed thread termination loop error.