bug-hurd
[Top][All Lists]
Advanced

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

[PATCH][libports] Unnecessary condition_broadcast (&_ports_block)


From: Ognyan Kulev
Subject: [PATCH][libports] Unnecessary condition_broadcast (&_ports_block)
Date: Wed, 03 Nov 2004 21:39:32 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20040926 Thunderbird/0.8 Mnenhy/0.6.0.104

Hi,

The attached patch fixes same type of typos in resume code of libports. This way the optimization to broadcast _ports_block only when needed is fixed.

Regards,
ogi
2004-11-03  Ognyan Kulev  <ogi@fmi.uni-sofia.bg>

        * resume-all-rpcs.c (ports_resume_all_rpcs): Broadcast block
        condition only when somebody else was blocked.
        * resume-bucket-rpcs.c (ports_resume_bucket_rpcs): Likewise.
        * resume-class-rpcs.c (ports_resume_class_rpcs): Likewise.
        * resume-port-rpcs.c (ports_resume_port_rpcs): Likewise.


Index: resume-all-rpcs.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/resume-all-rpcs.c,v
retrieving revision 1.1
diff -u -p -r1.1 resume-all-rpcs.c
--- resume-all-rpcs.c   20 Jun 1995 16:31:54 -0000      1.1
+++ resume-all-rpcs.c   3 Nov 2004 19:35:55 -0000
@@ -28,7 +28,7 @@ ports_resume_all_rpcs ()
   mutex_lock (&_ports_lock);
   assert (_ports_flags & _PORTS_INHIBITED);
   _ports_flags &= ~_PORTS_INHIBITED;
-  if (_ports_flags | _PORTS_BLOCKED)
+  if (_ports_flags & _PORTS_BLOCKED)
     {
       _ports_flags &= ~_PORTS_BLOCKED;
       condition_broadcast (&_ports_block);
Index: resume-bucket-rpcs.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/resume-bucket-rpcs.c,v
retrieving revision 1.1
diff -u -p -r1.1 resume-bucket-rpcs.c
--- resume-bucket-rpcs.c        20 Jun 1995 16:31:54 -0000      1.1
+++ resume-bucket-rpcs.c        3 Nov 2004 19:35:55 -0000
@@ -28,7 +28,7 @@ ports_resume_bucket_rpcs (struct port_bu
   mutex_lock (&_ports_lock);
   assert (bucket->flags & PORT_BUCKET_INHIBITED);
   bucket->flags &= ~PORT_BUCKET_INHIBITED;
-  if (bucket->flags | PORT_BUCKET_BLOCKED)
+  if (bucket->flags & PORT_BUCKET_BLOCKED)
     {
       bucket->flags &= ~PORT_BUCKET_BLOCKED;
       condition_broadcast (&_ports_block);
Index: resume-class-rpcs.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/resume-class-rpcs.c,v
retrieving revision 1.2
diff -u -p -r1.2 resume-class-rpcs.c
--- resume-class-rpcs.c 12 Jul 1995 20:29:08 -0000      1.2
+++ resume-class-rpcs.c 3 Nov 2004 19:35:55 -0000
@@ -28,7 +28,7 @@ ports_resume_class_rpcs (struct port_cla
   mutex_lock (&_ports_lock);
   assert (class->flags & PORT_CLASS_INHIBITED);
   class->flags &= ~PORT_CLASS_INHIBITED;
-  if (class->flags | PORT_CLASS_BLOCKED)
+  if (class->flags & PORT_CLASS_BLOCKED)
     {
       class->flags &= ~PORT_CLASS_BLOCKED;
       condition_broadcast (&_ports_block);
Index: resume-port-rpcs.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libports/resume-port-rpcs.c,v
retrieving revision 1.1
diff -u -p -r1.1 resume-port-rpcs.c
--- resume-port-rpcs.c  20 Jun 1995 16:31:54 -0000      1.1
+++ resume-port-rpcs.c  3 Nov 2004 19:35:55 -0000
@@ -31,7 +31,7 @@ ports_resume_port_rpcs (void *portstruct
   
   assert (pi->flags & PORT_INHIBITED);
   pi->flags &= ~PORT_INHIBITED;
-  if (pi->flags | PORT_BLOCKED)
+  if (pi->flags & PORT_BLOCKED)
     {
       pi->flags &= ~PORT_BLOCKED;
       condition_broadcast (&_ports_block);

reply via email to

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