Added semaphore to the document Queue

Added .cproject file
Added semaphores instead of while loop