#4 FIXES CRASH on 0.3.0: POSIX Uphold pthread's specification

open
nobody
None
9
2006-05-06
2006-02-23
No

Do not try to use a pthread_mutexattr_t variable
without first initializing it with
pthread_mutexattr_init(3)

The patch allows libjingle to compile under FreeBSD and
possibly other OSs which strictly follow the pthreads
standard which says nothing about pthread_mutexattr_t
other than there is a function to do it. Therefore,
assuming that using pthread_mutexattr_t without
initializing it is not guaranteed to work.

Discussion

  • Logged In: YES
    user_id=746415

    Affected file:

    talk/base/criticalsection.h

     
    • summary: FreeBSD - POSIX Initialize pthread_mutexattr_t --> Pthread POSIX - Uphold pthread's specification
     
  • Logged In: YES
    user_id=746415

    Furthermore, there should be a matching
    pthread_mutexattr_destroy() for each
    pthread_mutexattr_init().

    Affected file:

    talk/base/thread.cc

     
    • priority: 5 --> 9
    • summary: Pthread POSIX - Uphold pthread's specification --> Pthread POSIX - Uphold pthread's specification (FIXES CRASH)
     
  • Logged In: YES
    user_id=746415

    Affected file:

    talk/session/phone/linphonemediaengine.cc

     
    • summary: Pthread POSIX - Uphold pthread's specification (FIXES CRASH) --> FIXES CRASH: Pthread POSIX - Uphold pthread's specification
     
    • summary: FIXES CRASH: Pthread POSIX - Uphold pthread's specification --> FIXES CRASH on 0.3.0: POSIX Uphold pthread's specification
     
  • Logged In: YES
    user_id=746415

    Also, every pthread_mutexattr_init() requires a matching
    pthread_mutexattr_destroy() since the definition of
    pthread_mutexattr_t is unknown