Change thread/mutex implementation to pthread
Change inline in decalaration
Add thread/condition