patch-2.3.16 linux/net/ipv4/af_inet.c
Next file: linux/net/ipv4/arp.c
Previous file: linux/net/econet/econet.c
Back to the patch index
Back to the overall index
-  Lines: 37
-  Date:
Tue Aug 31 11:30:48 1999
-  Orig file: 
v2.3.15/linux/net/ipv4/af_inet.c
-  Orig date: 
Thu Aug 26 13:05:45 1999
diff -u --recursive --new-file v2.3.15/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
@@ -5,7 +5,7 @@
  *
  *		PF_INET protocol family socket handler.
  *
- * Version:	$Id: af_inet.c,v 1.94 1999/08/20 11:04:51 davem Exp $
+ * Version:	$Id: af_inet.c,v 1.95 1999/08/30 10:17:00 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -564,13 +564,9 @@
 {
 	DECLARE_WAITQUEUE(wait, current);
 
+	__set_current_state(TASK_INTERRUPTIBLE);
 	add_wait_queue(sk->sleep, &wait);
-	current->state = TASK_INTERRUPTIBLE;
 
-	/* RED-PEN. current->state is volatile. Is it enough to prevent
-	 * reordering it and sk->state check? I put barrier to be sure.
-	 */
-	barrier();
 	while ((1<<sk->state)&(TCPF_SYN_SENT|TCPF_SYN_RECV)) {
 		if (signal_pending(current))
 			break;
@@ -579,10 +575,9 @@
 		release_sock(sk);
 		schedule();
 		lock_sock(sk);
-		current->state = TASK_INTERRUPTIBLE;
-		barrier();
+		set_current_state(TASK_INTERRUPTIBLE);
 	}
-	current->state = TASK_RUNNING;
+	__set_current_state(TASK_RUNNING);
 	remove_wait_queue(sk->sleep, &wait);
 }
 
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)