Package org.jcsp.lang

Class Bucket

    • Constructor Detail

      • Bucket

        public Bucket()
    • Method Detail

      • fallInto

        public void fallInto()
        Fall into the bucket. The process doing this will be blocked until the next flush().
      • flush

        public int flush()
        Flush the bucket. All held processes will be released. It returns the number that were released.

        Returns:
        the number of processes flushed.
      • holding

        public int holding()
        This returns the number of processes currently held in the bucket. Note that this number is volatile - for information only! By the time the invoker of this method receives it, it might have changed (because of further processes falling into the bucket or someone flushing it).

        Returns:
        the number of processes currently held in the bucket.
      • create

        public static Bucket[] create​(int n)
        Creates an array of Buckets.

        Parameters:
        n - the number of Buckets to create in the array
        Returns:
        the array of Buckets