Timeout with multithread server

I wrote a server which creates a thread for every client connection. I have to include timeout function that will kill the server thread if the client doesn't respond for specific time. That too using signal(SIGALRM). For this i am using alarm() function.
When the server thread detects signal it calls the signal handler.
Problem i am facing is that: the signal handler function will be common to all threads. In that case how to do some cleanup functions for perticular server thread? (signal number is the only input to signalhandler)

i hope i explained my problem clearly
if anyone has given a thought on this problem, kindly help me out...
thanks in advance....

Can't you use any other method other than SIGALRM ... like instead of killing the thread, you call the thread to destroy/exit itself?