Changeset c0e01a28 in rtems


Ignore:
Timestamp:
Feb 24, 2015, 3:27:08 PM (4 years ago)
Author:
Gedare Bloom <gedare@…>
Branches:
4.11, master
Children:
bd1c9248
Parents:
ee870077
git-author:
Gedare Bloom <gedare@…> (02/24/15 15:27:08)
git-committer:
Gedare Bloom <gedare@…> (02/25/15 20:00:41)
Message:

posix: fix error return code for pthread_mutex_trylock

pthread_mutex_trylock() should return EBUSY if the mutex is already
locked. The translations of CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED is
EDEADLK which is correct for pthread_mutex_lock(). This fixes the
translation for trylock.

Closes #2170.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/mutextrylock.c

    ree870077 rc0e01a28  
    3838)
    3939{
    40   return _POSIX_Mutex_Lock_support( mutex, false, THREAD_QUEUE_WAIT_FOREVER );
     40  int r = _POSIX_Mutex_Lock_support( mutex, false, THREAD_QUEUE_WAIT_FOREVER );
     41  if ( r == EDEADLK )
     42    r = EBUSY;
     43  return r;
    4144}
  • doc/posix_users/mutex.t

    ree870077 rc0e01a28  
    581581ceiling.
    582582
    583 @item EDEADLK
    584 The current thread already owns the mutex.
     583@item EBUSY
     584The mutex is already locked.
    585585
    586586@end table
Note: See TracChangeset for help on using the changeset viewer.