add general functions file
add some syncro semaphore
rename old thread
add file to project and build script