diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-05-14 14:43:53 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-05-14 14:43:53 +0000 |
commit | a0b94685cd30e1ddae4572156da07b4fd9ee6a1b (patch) | |
tree | 9bd47fe9a18de21e5add69546f14a73b821668f7 /cpukit | |
parent | Removed -fomit-frame-pointer from all i386 BSPs since it breaks C++ (diff) | |
download | rtems-a0b94685cd30e1ddae4572156da07b4fd9ee6a1b.tar.bz2 |
Removed check for initialized ID at request of Rosimildo DaSilva
<rdasilva@connecttel.com> who encountered random failures in his
port of omniORB2.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/posix/src/mutex.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cpukit/posix/src/mutex.c b/cpukit/posix/src/mutex.c index 10a38a06e5..f5a817bcb8 100644 --- a/cpukit/posix/src/mutex.c +++ b/cpukit/posix/src/mutex.c @@ -234,6 +234,28 @@ int pthread_mutex_init( if ( !mutex ) return EINVAL; + /* + * This code should eventually be removed. + * + * Although the POSIX specification says: + * + * "Attempting to initialize an already initialized mutex results + * in undefined behavior." + * + * Trying to keep the caller from doing the create when *mutex + * is actually a valid ID causes grief. All it takes is the wrong + * value in an uninitialized variable to make this fail. As best + * I can tell, RTEMS was the only pthread implementation to choose + * this option for "undefined behavior" and doing so has created + * portability problems. In particular, Rosimildo DaSilva + * <rdasilva@connecttel.com> saw seemingly random failures in the + * RTEMS port of omniORB2 when this code was enabled. + * + * Joel Sherrill <joel@OARcorp.com> 14 May 1999 + */ + + +#if 0 /* avoid infinite recursion on call to this routine in _POSIX_Mutex_Get */ if ( *mutex != PTHREAD_MUTEX_INITIALIZER ) { @@ -250,6 +272,7 @@ int pthread_mutex_init( return EBUSY; } } +#endif if ( !the_attr->is_initialized ) return EINVAL; |