Hi,

this makes sure that the kernel thread is dead and gone on module unload.

        Regards
                Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[EMAIL PROTECTED], 2002-12-17 12:00:14+01:00, [EMAIL PROTECTED]
  - use a completion to wait for the kernel thread's death


 speedtouch.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)


diff -Nru a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
--- a/drivers/usb/misc/speedtouch.c     Tue Dec 17 12:01:52 2002
+++ b/drivers/usb/misc/speedtouch.c     Tue Dec 17 12:01:52 2002
@@ -144,8 +144,9 @@
 static const char udsl_driver_name[] = "Alcatel SpeedTouch USB";
 
 /* data thread */
-static int datapid = 0;
 DECLARE_WAIT_QUEUE_HEAD (udsl_wqh);
+static DECLARE_COMPLETION(thread_grave);
+static unsigned int datapid;
 
 #ifdef DEBUG_PACKET
 int udsl_print_packet (const unsigned char *data, int len);
@@ -443,9 +444,9 @@
        };
 
        remove_wait_queue (&udsl_wqh, &wait);
-       datapid = 0;
        PDEBUG ("SpeedSARd is exiting\n");
-       return 0;
+       complete_and_exit(&thread_grave, 0);
+       return 0; //never reached
 }
 
 
@@ -461,16 +462,7 @@
        /* Kill the thread */
        ret = kill_proc (datapid, SIGTERM, 1);
        if (!ret) {
-               /* Wait 10 seconds */
-               int count = 10 * 100;
-
-               while (datapid && --count) {
-                       current->state = TASK_INTERRUPTIBLE;
-                       schedule_timeout (1);
-               }
-
-               if (!count)
-                       err ("giving up on killing SpeedSAR thread.");
+               wait_for_completion(&thread_grave);
        }
 }
 

===================================================================


This BitKeeper patch contains the following changesets:
1.1116
## Wrapped with gzip_uu ##


begin 664 bkpatch10934
M'XL(`"`$_ST``\U486O;,!#];/V*@\+6T2669%FV4S*Z):$KZ]:0K9^#8U]L
MD\0.LMQVX!^_<]*U*XS0=?LP(]!9=WJZ]_30$5S7:`9.M2YNT+`C^%C5EGZQ
MK$KLY]4&UT79W/4KDU%R5E64=+ME=[_#7:QZUB#6;F:DSZAF&MLD!TK5`T?T
MO8<5^WV+`V<V.;^^?#]C;#B$41Z7&7Y%"\,A6ZS.T@;7_96IXKP[KGU(MY)S
M(83TN>=KX;<R]#S5"LT7*86I#*+E0D=LW]#9[UI_BB6%%`$/./>C5OF1C-@8
M1)].T,"E*V@$(.2`\X%0)UQ0``>PX41`C[,/\/<,1BR!'C0U0@Q)M=FNT195
M";:"V[BPL*P,V!QAA:;$-84&X_1U#2G&-F>?H..BV?115];[PX\Q'G/V#C*#
MV=F>!_71IJ9C7[M-O7`W19VX]18QM5634'ZG*`]ET,TR;+GR`]UVQ)8B4I$*
M(^ZGRT,*/@._NS$A2$35<BVUW/GGX+;.4_^>QD&3/8N&YJ'PI6@%]Z2Z-][+
M;.=#3WC_@^]V%W(%/7.[&V2CZ>&[>8$OQT*1.NQ"J!`DJVULBP3&DQ&])9/Y
MZ.KS]'+R[>+JR_&^N7EFXAM\<_JSL"GK(BLQA:*TD,8VWA;I*1LKI0F3IK"#
M5CMHYUX`G,=E.L>[PAZ_^A7T+7#"=0S:QI3`3\%U2R2J0"5)CBG!:06"$U[@
H$:SC=!K.2</YH[1/(0GOX94DB&15-YOA4F@O\O2"_0#^VE%]H@4`````
`
end



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to