add timeout to shm calls