Jinterface addition

Mickael Remond mickael.remond@REDACTED
Wed Mar 15 13:53:41 CET 2006


* Vlad Dumitrescu XX (LN/EAB) <vlad.xx.dumitrescu@REDACTED> [2006-03-15 13:00:06 +0100]:

> Hi,
>  
> Here is an addition to OtpEpmd.java, allowing programs to retrieve the
> list of registered nodes.

Hello,

I take the opportunity to submit another JInterface patch, developed by a
coworker (Nicolas Blanc).

GenericQueue has been patched to add a method to get a non-synchronized
compteur for the number of object in the queue. This information is
moving a lot and synchronisation does not seem relevant in this case.
If you want to take decision based on the result of this function if
will most likely have changed in the meantime.

The method getCount has also been added to OtpMbox to get the number of
messages waiting in a mailbox. It uses the method getUnsynchronizedCount
of GenericQueue. 

I hope this helps,

-- 
Mickaël Rémond
 http://www.process-one.net/

-------------- next part --------------
--- GenericQueue.java.orig	2006-03-10 10:11:09.000000000 +0100
+++ GenericQueue.java	2006-03-06 16:11:54.000000000 +0100
@@ -143,6 +143,10 @@
     return count;
   }
   
+  public int getUnsynchronizedCount() {
+    return count;
+  }
+	  
   /*
    * The Bucket class. The queue is implemented as a linked list
    * of Buckets. The container holds the queued object and a 
-------------- next part --------------
--- OtpMbox.java.orig	2006-03-10 10:11:10.000000000 +0100
+++ OtpMbox.java	2006-03-06 16:12:18.000000000 +0100
@@ -648,4 +648,8 @@
       }
     }
   }
+  
+  public int getCount() {
+	return this.queue.getUnsynchronizedCount();  
+  }
 }


More information about the erlang-bugs mailing list