Commit 2e4d3439 authored by Mahadev Konar's avatar Mahadev Konar
Browse files

ZOOKEEPER-218. fix the error in the barrier example code. (pat via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/branches/branch-3.0@718759 13f79535-47bb-0310-9956-ffa450edef68
parent a39cf77e
......@@ -20,6 +20,8 @@ via mahadev)
ZOOKEEPER-228. fix apache header missing in DBTest. (mahadev)
ZOOKEEPER-218. fix the error in the barrier example code. (pat via mahadev)
Release 3.0.0 - 2008-10-21
Non-backward compatible changes:
......
......@@ -292,12 +292,12 @@ we call root (<strong>Note:</strong> This is not the ZooKeeper root "/").</p>
* Barrier constructor
*
* @param address
* @param name
* @param root
* @param size
*/
Barrier(String address, String name, int size) {
Barrier(String address, String root, int size) {
super(address);
this.root = name;
this.root = root;
this.size = size;
// Create barrier node
......@@ -348,7 +348,7 @@ a boolean flag that enables the process to set a watch. In the code the flag is
boolean enter() throws KeeperException, InterruptedException{
zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
CreateMode.EPHEMERAL);
CreateMode.EPHEMERAL_SEQUENTIAL);
while (true) {
synchronized (mutex) {
List&lt;String&gt; list = zk.getChildren(root, true);
......@@ -590,12 +590,12 @@ public class SyncPrimitive implements Watcher {
* Barrier constructor
*
* @param address
* @param name
* @param root
* @param size
*/
Barrier(String address, String name, int size) {
Barrier(String address, String root, int size) {
super(address);
this.root = name;
this.root = root;
this.size = size;
// Create barrier node
......@@ -634,7 +634,7 @@ public class SyncPrimitive implements Watcher {
boolean enter() throws KeeperException, InterruptedException{
zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
CreateMode.EPHEMERAL);
CreateMode.EPHEMERAL_SEQUENTIAL);
while (true) {
synchronized (mutex) {
List&lt;String&gt; list = zk.getChildren(root, true);
......
......@@ -125,12 +125,12 @@ we call root (<emphasis role="bold">Note:</emphasis> This is not the ZooKeeper r
* Barrier constructor
*
* @param address
* @param name
* @param root
* @param size
*/
Barrier(String address, String name, int size) {
Barrier(String address, String root, int size) {
super(address);
this.root = name;
this.root = root;
this.size = size;
// Create barrier node
......@@ -182,7 +182,7 @@ a boolean flag that enables the process to set a watch. In the code the flag is
boolean enter() throws KeeperException, InterruptedException{
zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
CreateMode.EPHEMERAL);
CreateMode.EPHEMERAL_SEQUENTIAL);
while (true) {
synchronized (mutex) {
List&lt;String&gt; list = zk.getChildren(root, true);
......@@ -422,12 +422,12 @@ public class SyncPrimitive implements Watcher {
* Barrier constructor
*
* @param address
* @param name
* @param root
* @param size
*/
Barrier(String address, String name, int size) {
Barrier(String address, String root, int size) {
super(address);
this.root = name;
this.root = root;
this.size = size;
// Create barrier node
......@@ -466,7 +466,7 @@ public class SyncPrimitive implements Watcher {
boolean enter() throws KeeperException, InterruptedException{
zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
CreateMode.EPHEMERAL);
CreateMode.EPHEMERAL_SEQUENTIAL);
while (true) {
synchronized (mutex) {
List&lt;String&gt; list = zk.getChildren(root, true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment