Browse Source

Don't miss dropping stratifier clients whose dropped flag is set when no reference count is held

master
Con Kolivas 10 years ago
parent
commit
a80f9aa492
  1. 8
      src/stratifier.c

8
src/stratifier.c

@ -1534,13 +1534,13 @@ static void drop_client(ckpool_t *ckp, sdata_t *sdata, const int64_t id)
client = __instance_by_id(sdata, id); client = __instance_by_id(sdata, id);
/* Upgrade to write lock */ /* Upgrade to write lock */
ck_ulock(&sdata->instance_lock); ck_ulock(&sdata->instance_lock);
if (client && !client->dropped) { if (client) {
user = client->user_instance;
/* If the client is still holding a reference, don't drop them /* If the client is still holding a reference, don't drop them
* now but wait till the reference is dropped */ * now but wait till the reference is dropped */
if (!client->ref) if (!client->ref) {
user = client->user_instance;
dropped = __drop_client(sdata, client, user); dropped = __drop_client(sdata, client, user);
else } else
client->dropped = true; client->dropped = true;
} }

Loading…
Cancel
Save