From: Aurelio <sk...@us...> - 2006-11-18 13:00:53
|
Update of /cvsroot/zyxel630-11/amedyn2/module In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29214 Modified Files: usbatm.c Log Message: Fix for very unlikely race: if the thread manages to exit before pid was assigned, pid will not be set to -1, and the wrong thread may be shot down on modem disconnect. (usbatm CVS 1.67) Index: usbatm.c =================================================================== RCS file: /cvsroot/zyxel630-11/amedyn2/module/usbatm.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** usbatm.c 18 Nov 2006 12:55:08 -0000 1.16 --- usbatm.c 18 Nov 2006 13:00:49 -0000 1.17 *************** *** 1074,1077 **** --- 1074,1078 ---- daemonize(instance->driver->driver_name); allow_signal(SIGTERM); + instance->thread_pid = get_current()->pid; complete(&instance->thread_started); *************** *** 1098,1105 **** } - mutex_lock(&instance->serialize); - instance->thread_pid = ret; - mutex_unlock(&instance->serialize); - wait_for_completion(&instance->thread_started); --- 1099,1102 ---- |