Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Aug 2015 16:38:07 GMT
From:      stefano@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r289216 - soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap
Message-ID:  <201508041638.t74Gc7FZ073497@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: stefano
Date: Tue Aug  4 16:38:07 2015
New Revision: 289216
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289216

Log:
  [ptnetmap] use thread_suspend_check() instead of kthread_suspend_check()
  
  thread_suspend_check() must be used if the kthread is attached to
  user process

Modified:
  soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c

Modified: soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c
==============================================================================
--- soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c	Tue Aug  4 15:15:06 2015	(r289215)
+++ soc2015/stefano/ptnetmap/stable/10/sys/dev/netmap/netmap_freebsd.c	Tue Aug  4 16:38:07 2015	(r289216)
@@ -972,7 +972,13 @@
 	thread_unlock(curthread);
 
 	while (nmk->run) {
+		/* check if the parent process dies */
+		PROC_LOCK(curproc);
+		thread_suspend_check(0);
+		PROC_UNLOCK(curproc);
+#if 0
 		kthread_suspend_check();
+#endif
 
 		new_scheduled = nmk->scheduled;
 
@@ -983,7 +989,7 @@
 		} else if (nmk->run) {
 			if (ctx->ioevent_file) {
 				/* wait on event with timetout 1 second */
-				tsleep_sbt(ctx->ioevent_file, PPAUSE, "nmk_event", SBT_1S, SBT_1MS, C_ABSOLUTE);
+				tsleep_sbt(ctx->ioevent_file, PPAUSE, "nmk_event", SBT_1S, SBT_1S, C_ABSOLUTE);
 				nmk->scheduled++;
 			}
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508041638.t74Gc7FZ073497>