Moved code to ubuntu - addressed C99 issues
Should work, but gets stuck on sem_wait