Skip to content

Intended unlock in kvs_update? #186

@Medowhill

Description

@Medowhill

Hi. I'm a researcher working on concurrent programs written in C and completely new to this project.

While reading the code, I found the following part in kvs_update:

streem/src/kvs.c

Lines 113 to 119 in d022e83

pthread_mutex_unlock(&k->lock);
/* call function */
if (strm_funcall(strm, args[2], 1, &old, &val) == STRM_NG) {
pthread_mutex_unlock(&k->lock);
return STRM_NG;
}

After k->lock is released in 113, it's released again in line 117. Unless strm_funcall returns after acquiring k->lock, line 117 would not be necessary. I don't fully understand the behavior of strm_funcall, but I can't find such cases yet. I'm wondering whether line 117 is intentional and necessary or could be removed.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions