Skip to content

A potential error due to the unreleased lock  #15

@ycaibb

Description

@ycaibb

Dear developers: Thank you for your checking. It seems there is a lock resource leak on the lock paused. I think the lock should be released at the end of do_pause?

static void
do_pause (void)
{
if (is_paused) return;
/* Grabbing the paused lock is enough to stop request processing. */
pthread_mutex_lock (&paused);
is_paused = true;
/* However we must also wait until all outstanding requests have
* been completed before we send the acknowledgement.
*/
nbdkit_debug ("pause: pausing, waiting for requests to complete");
ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&count_lock);
while (count_requests > 0)
pthread_cond_wait (&count_cond, &count_lock);
nbdkit_debug ("pause: paused");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions