Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • L libbluray
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 5
    • Issues 5
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VideoLAN
  • libbluray
  • Merge requests
  • !17

Merged
Created Feb 13, 2020 by Marvin Scholz@ePiratContributor

mutex: Switch the POSIX backend to PTHREAD_MUTEX_RECURSIVE

  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1

The code for recursive mutexes triggered Undefined Behavior and crash as pthread_equal(3) was not used in a portable way. On the first call of mutex_lock() pthread_equal() was called with a pthread_t of value -1 which is invalid.

Passing a non valid thread ID to pthread_equal is undefined.

Switch the backend to native interface for POSIX recursive mutexes with PTHREAD_MUTEX_RECURSIVE and simplify the code.

Detected on NetBSD/amd64 9.99.46.

Signed-off-by: Marvin Scholz epirat07@gmail.com

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: pthread-recursive-fix

VideoLAN code repository instance