Github user breed commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/90#discussion_r87652058
  
    --- Diff: src/c/src/zookeeper.c ---
    @@ -4052,6 +3958,76 @@ int zoo_amulti(zhandle_t *zh, int count, const 
zoo_op_t *ops,
         return (rc < 0) ? ZMARSHALLINGERROR : ZOK;
     }
     
    +
    +int zoo_aremove_watchers(zhandle_t *zh, const char *path, ZooWatcherType 
wtype,
    +        watcher_fn watcher, void *watcherCtx, int local,
    +        void_completion_t *completion, const void *data)
    +{
    +    char *server_path = prepend_string(zh, path);
    +    int rc;
    +    struct oarchive *oa;
    +    struct RequestHeader h = { get_xid(), ZOO_REMOVE_WATCHES };
    +    struct RemoveWatchesRequest req =  { (char*)server_path, wtype };
    +    watcher_deregistration_t *wdo;
    +
    +    if (!zh || !isValidPath(server_path, 0)) {
    +        rc = ZBADARGUMENTS;
    +        goto done;
    +    }
    +
    +    if (!local && is_unrecoverable(zh)) {
    +        rc = ZINVALIDSTATE;
    +        goto done;
    +    }
    +
    +    if (!pathHasWatcher(zh, server_path, wtype, watcher, watcherCtx)) {
    +        rc = ZNOWATCHER;
    +        goto done;
    +    }
    +
    +    if (local) {
    +        removeWatchers(zh, server_path, wtype, watcher, watcherCtx);
    +#ifdef THREADED
    +        notify_sync_completion((struct sync_completion *)data);
    --- End diff --
    
    so, just to be clear. is this change correct? we don't need to call 
notify_sync_completion in the non-threaded case. right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to