commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnumach/oskit ds_routines.c


From: Roland McGrath
Subject: gnumach/oskit ds_routines.c
Date: Tue, 12 Nov 2002 22:30:44 -0500

CVSROOT:        /cvsroot/hurd
Module name:    gnumach
Changes by:     Roland McGrath <address@hidden> 02/11/12 22:30:44

Modified files:
        oskit          : ds_routines.c 

Log message:
        2002-11-12  Roland McGrath  <address@hidden>
        
        * oskit/ds_routines.c (dev_open_com): Revert last change.
        The hash table should not hold a reference.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnumach/gnumach/oskit/ds_routines.c.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: gnumach/oskit/ds_routines.c
diff -u gnumach/oskit/ds_routines.c:1.8 gnumach/oskit/ds_routines.c:1.9
--- gnumach/oskit/ds_routines.c:1.8     Sat Nov  9 20:54:52 2002
+++ gnumach/oskit/ds_routines.c Tue Nov 12 22:30:44 2002
@@ -396,13 +396,11 @@
   dev->mode = mode;
   dev->ops = 0;
 
-  /* The newly allocated device has one reference on it.  The slot hash
-     table will hold one reference, and we will consume another below.  */
-  assert (dev->ref_count == 1);
-  dev->ref_count == 2;
-
-  /* Put the device in the hash table under its COM device.
-     After this point we need to use device_lock.  */
+  /* Put the device in the hash table under its COM device.  We hold the
+     only reference to the device, and releasing that reference will remove
+     it from the hash table.  While it's live, someone else might come
+     along and find it in the hash table and get their own reference to
+     keep it there.  After this point we need to use device_lock.  */
   simple_lock (&dev_hash_lock);
   dev_hash_enter (dev);
   simple_unlock (&dev_hash_lock);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]