summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadequal.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-03-05 20:53:05 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-03-05 20:53:05 +0000
commit7f5fc4eda380c152e07761e0ac95403076b644b3 (patch)
treee0ff771c3313f5becabb329046b1035631ae81d4 /cpukit/posix/src/pthreadequal.c
parent2007-03-05 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-7f5fc4eda380c152e07761e0ac95403076b644b3.tar.bz2
2007-03-05 Joel Sherrill <joel@OARcorp.com>
PR 1221/cpukit * posix/src/pthreadequal.c: Fix critical section nesting.
Diffstat (limited to 'cpukit/posix/src/pthreadequal.c')
-rw-r--r--cpukit/posix/src/pthreadequal.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cpukit/posix/src/pthreadequal.c b/cpukit/posix/src/pthreadequal.c
index 39136cc388..2b15761886 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
}