add throwing exception if create thread failure
add return value of StartMainLoop
change exception type
little change
code cosmetics

- update header includes
- bugfix catch blocks