\"\" \"\" \"\"
Go backward to Open(): Open a Bag
Go up to Constructors
Go forward to ThreadBagn: Adding a Thread
RISC-Linz logo

open(): Open a Bag (Binding Form)

b.open()
b.open(n)
      ThreadBag<T> b
      int n

Specification: Binds b to a new and empty bag. This overrides any previous binding of b.

  1. In the first form, b is open and may collect an arbitrary number of threads.
  2. In the second form, b is closed and at most n more threads may be added to the bag.
Constraint: It is illegal to apply open to n<0.

Note: The second operation is equivalent to 

b.open()
b->close(n)
Both operations are more efficient than the otherwise equivalent forms 
b = ThreadBag<T>::Open()
b = ThreadBag<T>::Open(n)

Author: Wolfgang Schreiner
Last Modification: April 12, 1997