Create trylock.c

pthread_trylock() lets the thread continue processing the task locally and finally update the global shared resource finally. This will allow the thread unnecessarily waiting for acquiring lock.