Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jul 2006 19:52:47 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 101590 for review
Message-ID:  <200607141952.k6EJqlSJ029829@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101590

Change 101590 by jhb@jhb_mutex on 2006/07/14 19:52:30

	Use TAILQ_HEAD_INITIALIZER() to avoid pain.

Affected files ...

.. //depot/projects/smpng/sys/dev/streams/streams.c#23 edit

Differences ...

==== //depot/projects/smpng/sys/dev/streams/streams.c#23 (text+ko) ====

@@ -68,11 +68,8 @@
 static int svr4_ptm_alloc(struct thread *);
 static  d_open_t	streamsopen;
 
-struct svr4_sockcache_head svr4_head;
+struct svr4_sockcache_head svr4_head = TAILQ_HEAD_INITIALIZER(svr4_head);
 
-/* Initialization flag (set/queried by svr4_mod LKM) */
-int svr4_str_initialized = 0;
-
 /*
  * Device minor numbers
  */
@@ -390,14 +387,6 @@
 	struct svr4_sockcache_entry *e;
 	void *cookie = ((struct socket *)fp->f_data)->so_emuldata;
 
-	while (svr4_str_initialized != 2) {
-		if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) {
-			TAILQ_INIT(&svr4_head);
-			atomic_store_rel_int(&svr4_str_initialized, 2);
-		}
-		return;
-	}
-
 	TAILQ_FOREACH(e, &svr4_head, entries)
 		if (e->p == p && e->cookie == cookie) {
 			TAILQ_REMOVE(&svr4_head, e, entries);



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