diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-03-05 20:54:12 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-03-05 20:54:12 +0000 |
commit | 487a504e0ef0d05bb160a0c34a3676d3ca909563 (patch) | |
tree | fdfdcb854de6690495777a4d7fb43c416676daa0 | |
parent | 7ee00539286617ebe095d93ecc82af1c55e117f5 (diff) |
2007-03-05 Joel Sherrill <joel@OARcorp.com>
PR 1221/cpukit
* src/pthreadequal.c: Fix critical section nesting.
-rw-r--r-- | cpukit/posix/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/posix/src/pthreadequal.c | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/cpukit/posix/ChangeLog b/cpukit/posix/ChangeLog index 87562e4434..232905fb41 100644 --- a/cpukit/posix/ChangeLog +++ b/cpukit/posix/ChangeLog @@ -1,3 +1,8 @@ +2007-03-05 Joel Sherrill <joel@OARcorp.com> + + PR 1221/cpukit + * src/pthreadequal.c: Fix critical section nesting. + 2005-09-01 Joel Sherrill <joel@OARcorp.com> PR 796/rtems diff --git a/cpukit/posix/src/pthreadequal.c b/cpukit/posix/src/pthreadequal.c index 0f5442176d..7eea61c7db 100644 --- a/cpukit/posix/src/pthreadequal.c +++ b/cpukit/posix/src/pthreadequal.c @@ -3,7 +3,7 @@ * * NOTE: POSIX does not define the behavior when either thread id is invalid. * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -55,6 +55,7 @@ int pthread_equal( switch ( location ) { case OBJECTS_ERROR: case OBJECTS_REMOTE: + /* return status == 0 */ break; case OBJECTS_LOCAL: @@ -67,16 +68,18 @@ int pthread_equal( switch ( location ) { case OBJECTS_ERROR: case OBJECTS_REMOTE: + /* t1 must have been valid so exit the critical section */ + _Thread_Enable_dispatch(); + /* return status == 0 */ break; case OBJECTS_LOCAL: status = _Objects_Are_ids_equal( t1, t2 ); - break; + _Thread_Unnest_dispatch(); + _Thread_Enable_dispatch(); + break; } - _Thread_Unnest_dispatch(); break; } - - _Thread_Enable_dispatch(); return status; #endif } |