Code Monkey home page Code Monkey logo

Comments (3)

bluebore avatar bluebore commented on May 20, 2024

linux下,重复加锁是会死锁的,所以当前实现是可以工作的,我会再研究下其他几种类型,看哪个更适合替换。
关闭issue的原因是什么,你又有新的发现?

from bfs.

yvxiang avatar yvxiang commented on May 20, 2024

上午看错了,以为当前代码中有重复加锁的地方,但是居然没有死锁,现在排查清楚了,是看错了锁……

POSIX标准的手册中写的在PTHREAD_MUTEX_DEFAULT情况下,重复加锁会导致不确定行为,linux的一些版本中,PTHREAD_MUTEX_DEFAULT被映射到了PTHREAD_MUTEX_NORMAL,这样便会导致死锁。但这种映射是没有保证的。所以我感觉还是有必要替换一下的,至少应该改为PTHREAD_MUTEX_NORMAL。

from bfs.

bluebore avatar bluebore commented on May 20, 2024

已经移到baidu/common中了

from bfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.