[haiku-bugs] Re: [Haiku] #5336: pthread_mutex_trylock() hangs

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Fri, 29 Jan 2010 16:30:03 -0000

#5336: pthread_mutex_trylock() hangs
--------------------------+-------------------------------------------------
 Reporter:  kaliber       |       Owner:  nobody        
     Type:  bug           |      Status:  new           
 Priority:  normal        |   Milestone:  R1            
Component:  System/POSIX  |     Version:  R1/Development
 Keywords:                |   Blockedby:                
 Platform:  All           |    Blocking:                
--------------------------+-------------------------------------------------

Comment(by bonefish):

 Confirmed. The pthread_mutex_trylock() implementation is incorrect. It
 should not even touch the semaphore, but instead use atomic_test_and_set()
 on the count. Moreover the kernel's thread_block_with_timeout_locked()
 needs to check for an overflow in case B_TIMEOUT_REAL_TIME_BASE is set.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5336#comment:1>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: