Skip to content

mutexlock类的析构函数 #138

Open

Description

@lllllinux

不应该先释放锁再destroy吗,怎么mutexlock.h里面的析构函数先lock(mutex)再destroy

Activity

  1. xu-cell commented on Nov 8, 2022

    @xu-cell

    我也有这个疑问!!,muduo库里面是维护一个pid_t 类型的holder变量来判断是否有线程持有锁。在析构函数里判断assert(holder == 0),如果等于0,才destroy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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