BUG#: 7912
authorkumpf <kumpf>
Tue, 16 Sep 2008 18:37:03 +0000 (18:37 +0000)
committerkumpf <kumpf>
Tue, 16 Sep 2008 18:37:03 +0000 (18:37 +0000)
TITLE: WaitFailed exception should include diagnostic information
DESCRIPTION: Throw an Exception on locking primitive failures instead of the WaitFailed IPCException.

14 files changed:
src/Pegasus/Common/AsyncQueue.h
src/Pegasus/Common/Cimom.cpp
src/Pegasus/Common/IPCExceptions.h
src/Pegasus/Common/MessageQueueService.cpp
src/Pegasus/Common/Mutex.cpp
src/Pegasus/Common/Mutex.h
src/Pegasus/Common/ReadWriteSem.cpp
src/Pegasus/Common/ReadWriteSem.h
src/Pegasus/Common/Semaphore.cpp
src/Pegasus/Common/Semaphore.h
src/Pegasus/Common/Thread.cpp
src/Pegasus/Common/tests/Thread/Thread.cpp
src/Pegasus/Security/UserManager/UserFileHandler.cpp
src/Pegasus/msg/Server/pegasusServer_en.txt

index fb8e87c0fd54702f544d0848a31af781844a52cb..80c42754db4411d8add67daaa00c97bcb6eee18c 100644 (file)
@@ -37,6 +37,7 @@
 #include <Pegasus/Common/Linkage.h>
 #include <Pegasus/Common/List.h>
 #include <Pegasus/Common/Condition.h>
+#include <Pegasus/Common/IPCExceptions.h>
 
 PEGASUS_NAMESPACE_BEGIN
 
index 6d6382b0584100b6b82a2c149bc17a450ceccc30..ac3d0c441752d4721078b053b44d0a030cd62a9a 100644 (file)
@@ -539,7 +539,7 @@ void cimom::register_module(RegisterCimService *msg)
             {
                 _modules.insert_front(new_mod.get());
             }
-            catch (IPCException&)
+            catch (...)
             {
                 result = async_results::INTERNAL_ERROR;
                 new_mod.reset();
@@ -656,12 +656,12 @@ void cimom::ioctl(AsyncIoctl* msg)
             // empty out the queue
             while (1)
             {
-                AsyncOpNode *operation;
+                AsyncOpNode* operation = 0;
                 try
                 {
                     operation = service->_routed_ops.dequeue();
                 }
-                catch (IPCException&)
+                catch (...)
                 {
                     break;
                 }
index 033a1bd1b0c96adcd3a365fd2a0ea80625d5351e..767ed5960afba5ad4b6d6f76179e0b7180977971 100644 (file)
@@ -48,14 +48,6 @@ private:
     ThreadType _owner;
 };
 
-class PEGASUS_COMMON_LINKAGE WaitFailed: public IPCException
-{
-public:
-    WaitFailed(ThreadType owner) : IPCException(owner) {}
-private:
-    WaitFailed();
-};
-
 class PEGASUS_COMMON_LINKAGE ListClosed: public IPCException
 {
 public:
index a212c7bb2f5281a2db9e9615435f0adf0cb0b0b6..f88abdc084bf76be9ee03845d4b4dd50b4fb1a60 100644 (file)
@@ -720,12 +720,12 @@ void MessageQueueService::handle_AsyncIoctl(AsyncIoctl* req)
             // empty out the queue
             while (1)
             {
-                AsyncOpNode *operation;
+                AsyncOpNode* operation = 0;
                 try
                 {
                     operation = service->_incoming.dequeue();
                 }
-                catch (IPCException&)
+                catch (...)
                 {
                     break;
                 }
index 0e6476a4e3f43746348151d143494b76efe18ffe..89cfb571651662b39814471329579f38878e7fb0 100644 (file)
 #include "Time.h"
 #include "PegasusAssert.h"
 #include "Once.h"
+#include "Exception.h"
+#include "System.h"
+
+#define MUTEX_LOCK_FAILED_KEY "Common.InternalException.MUTEX_LOCK_FAILED"
+#define MUTEX_LOCK_FAILED_MSG "Failed to acquire mutex lock: $0"
 
 PEGASUS_NAMESPACE_BEGIN
 
@@ -91,16 +96,26 @@ void Mutex::lock()
 {
     PEGASUS_DEBUG_ASSERT(_magic);
 
-    switch (pthread_mutex_lock(&_rep.mutex))
+    int r = pthread_mutex_lock(&_rep.mutex);
+
+    if (r == 0)
     {
-        case 0:
 #if defined(PEGASUS_DEBUG)
-            _rep.count++;
+        _rep.count++;
 #endif
-            break;
+    }
+    else
+    {
+        if (r != -1)
+        {
+            // Special behavior for Single UNIX Specification, Version 3
+            errno = r;
+        }
 
-        default:
-            throw WaitFailed(Threads::self());
+        throw Exception(MessageLoaderParms(
+            MUTEX_LOCK_FAILED_KEY,
+            MUTEX_LOCK_FAILED_MSG,
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
 }
 
@@ -109,8 +124,6 @@ Boolean Mutex::try_lock()
     PEGASUS_DEBUG_ASSERT(_magic);
 
     int r = pthread_mutex_trylock(&_rep.mutex);
-    if (r == -1)
-        r=errno;
 
     if (r == 0)
     {
@@ -120,18 +133,25 @@ Boolean Mutex::try_lock()
         return true;
     }
 
-    if (r == EBUSY)
+    if (r != -1)
+    {
+        // Special behavior for Single UNIX Specification, Version 3
+        errno = r;
+    }
+
+    if (errno == EBUSY)
     {
         return false;
     }
 
-    throw WaitFailed(Threads::self());
+    throw Exception(MessageLoaderParms(
+        MUTEX_LOCK_FAILED_KEY,
+        MUTEX_LOCK_FAILED_MSG,
+        PEGASUS_SYSTEM_ERRORMSG_NLS));
 }
 
 Boolean Mutex::timed_lock(Uint32 milliseconds)
 {
-    PEGASUS_DEBUG_ASSERT(_magic);
-
     struct timeval now;
     struct timeval finish;
     struct timeval remaining;
@@ -145,36 +165,18 @@ Boolean Mutex::timed_lock(Uint32 milliseconds)
         finish.tv_usec = usec % 1000000;
     }
 
-    for (;;)
+    while (!try_lock())
     {
-        int r=pthread_mutex_trylock(&_rep.mutex);
-        if (r == -1)
-            r = errno;
+        gettimeofday(&now, NULL);
 
-        if (r == 0)
+        if (Time::subtract(&remaining, &finish, &now))
         {
-            break;
+            return false;
         }
-        else if (r == EBUSY)
-        {
-            gettimeofday(&now, NULL);
-
-            if (Time::subtract(&remaining, &finish, &now))
-            {
-                return false;
-            }
 
-            Threads::yield();
-        }
-        else
-        {
-            throw WaitFailed(Threads::self());
-        }
+        Threads::yield();
     }
 
-#if defined(PEGASUS_DEBUG)
-    _rep.count++;
-#endif
     return true;
 }
 
@@ -249,7 +251,12 @@ void Mutex::lock()
     DWORD rc = WaitForSingleObject(_rep.handle, INFINITE);
 
     if (rc == WAIT_FAILED)
-        throw WaitFailed(Threads::self());
+    {
+        throw Exception(MessageLoaderParms(
+            MUTEX_LOCK_FAILED_KEY,
+            MUTEX_LOCK_FAILED_MSG,
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
+    }
 
     _rep.count++;
 }
@@ -267,7 +274,10 @@ Boolean Mutex::try_lock()
 
     if (rc == WAIT_FAILED)
     {
-        throw WaitFailed(Threads::self());
+        throw Exception(MessageLoaderParms(
+            MUTEX_LOCK_FAILED_KEY,
+            MUTEX_LOCK_FAILED_MSG,
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
 
     _rep.count++;
@@ -284,7 +294,12 @@ Boolean Mutex::timed_lock(Uint32 milliseconds)
         return false;
 
     if (rc == WAIT_FAILED)
-        throw WaitFailed(Threads::self());
+    {
+        throw Exception(MessageLoaderParms(
+            MUTEX_LOCK_FAILED_KEY,
+            MUTEX_LOCK_FAILED_MSG,
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
+    }
 
     _rep.count++;
     return true;
index 430662b90c1f25fd0cb312383f7fb991fafa5f20..3a251fff78c5680eae8c8146a907e2d1a3cd56bd 100644 (file)
@@ -36,7 +36,6 @@
 
 #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/Linkage.h>
-#include <Pegasus/Common/IPCExceptions.h>
 #include <Pegasus/Common/Magic.h>
 #include <Pegasus/Common/Threads.h>
 
index 87df24c3ea5647f32e6249c51179c2d137bda63b..4f19bbaf2c8a8fbb976c57b0ab781d93e2920808 100644 (file)
@@ -35,6 +35,8 @@
 #include "Time.h"
 #include "PegasusAssert.h"
 #include "Threads.h"
+#include "Exception.h"
+#include "System.h"
 
 PEGASUS_NAMESPACE_BEGIN
 
@@ -63,17 +65,39 @@ ReadWriteSem::~ReadWriteSem()
 
 void ReadWriteSem::waitRead()
 {
-    if (pthread_rwlock_rdlock(&_rwlock.rwlock) != 0)
+    int r = pthread_rwlock_rdlock(&_rwlock.rwlock);
+
+    if (r != 0)
     {
-        throw WaitFailed(Threads::self());
+        if (r != -1)
+        {
+            // Special behavior for Single UNIX Specification, Version 3
+            errno = r;
+        }
+
+        throw Exception(MessageLoaderParms(
+            "Common.InternalException.READ_LOCK_FAILED",
+            "Failed to acquire read lock: $0",
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
 }
 
 void ReadWriteSem::waitWrite()
 {
-    if (pthread_rwlock_wrlock(&_rwlock.rwlock) != 0)
+    int r = pthread_rwlock_wrlock(&_rwlock.rwlock);
+
+    if (r != 0)
     {
-        throw WaitFailed(Threads::self());
+        if (r != -1)
+        {
+            // Special behavior for Single UNIX Specification, Version 3
+            errno = r;
+        }
+
+        throw Exception(MessageLoaderParms(
+            "Common.InternalException.WRITE_LOCK_FAILED",
+            "Failed to acquire write lock: $0",
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
 }
 
@@ -117,7 +141,7 @@ ReadWriteSem::~ReadWriteSem()
     {
         _rwlock._internal_lock.lock();
     }
-    catch (IPCException &)
+    catch (...)
     {
         PEGASUS_ASSERT(0);
     }
index 51e6218107e0a9392a5700fc4e187c3f4470124c..5dc722a516f4b53a7fa8174454609db2219db88b 100644 (file)
@@ -99,10 +99,8 @@ public:
 
     ~ReadWriteSem();
 
-    // @exception WaitFailed
     void waitRead();
 
-    // @exception WaitFailed
     void waitWrite();
 
     void unlockRead();
index 2a34268a41de8f7bf044ef3e67ed73bc9fc65996..d2987afedc7e91fd97bf0ebfa7462a2febdc7c3c 100644 (file)
@@ -32,7 +32,8 @@
 //%/////////////////////////////////////////////////////////////////////////////
 
 #include <Pegasus/Common/Time.h>
-#include <Pegasus/Common/IPCExceptions.h>
+#include <Pegasus/Common/Exception.h>
+#include <Pegasus/Common/System.h>
 #include "Semaphore.h"
 
 PEGASUS_NAMESPACE_BEGIN
@@ -54,11 +55,11 @@ Semaphore::Semaphore(Uint32 initial)
 
     if (initial > PEGASUS_SEM_VALUE_MAX)
     {
-        _count = PEGASUS_SEM_VALUE_MAX - 1;
+        _rep.count = PEGASUS_SEM_VALUE_MAX - 1;
     }
     else
     {
-        _count = initial;
+        _rep.count = initial;
     }
 
     _rep.owner = Threads::self();
@@ -139,7 +140,7 @@ void Semaphore::wait()
 
     // Wait until the semaphore count is > 0, then atomically release
     // <lock_> and wait for <count_nonzero_> to be signaled.
-    while (_count == 0)
+    while (_rep.count == 0)
     {
         pthread_cond_wait(&_rep.cond, &_rep.mutex);
     }
@@ -150,7 +151,7 @@ void Semaphore::wait()
     _rep.waiters--;
 
     // Decrement the semaphore's count.
-    _count--;
+    _rep.count--;
 
     // Since we push an unlock onto the cleanup stack
     // We will pop it off to release the mutex when leaving the critical
@@ -188,12 +189,12 @@ Boolean Semaphore::time_wait(Uint32 milliseconds)
     waittime.tv_nsec = (waittime.tv_nsec % 1000000);    // the "seconds" part
     waittime.tv_nsec = waittime.tv_nsec * 1000; // convert to nanoseconds
 
-    while ((_count == 0) && !timedOut)
+    while ((_rep.count == 0) && !timedOut)
     {
         int r = pthread_cond_timedwait(&_rep.cond, &_rep.mutex, &waittime);
 
         if (((r == -1 && errno == ETIMEDOUT) || (r == ETIMEDOUT)) &&
-            _count == 0)
+            _rep.count == 0)
         {
             timedOut = true;
         }
@@ -202,7 +203,7 @@ Boolean Semaphore::time_wait(Uint32 milliseconds)
     if (!timedOut)
     {
         // Decrement the semaphore's count.
-        _count--;
+        _rep.count--;
     }
 
     // Decrement the waiters count.
@@ -234,17 +235,11 @@ void Semaphore::signal()
     }
 
     // Increment the semaphore's count.
-    _count++;
+    _rep.count++;
 
     pthread_mutex_unlock(&_rep.mutex);
 }
 
-// return the count of the semaphore
-int Semaphore::count() const
-{
-    return _count;
-}
-
 #endif /* PEGASUS_USE_PTHREAD_SEMAPHORE */
 
 //==============================================================================
@@ -265,7 +260,10 @@ Semaphore::Semaphore(Uint32 initial)
     _rep.owner = Threads::self();
     if (sem_init(&_rep.sem, 0, initial) == -1)
     {
-        throw(IPCException(_rep.owner));
+        throw Exception(MessageLoaderParms(
+            "Common.InternalException.SEMAPHORE_INIT_FAILED",
+            "Semaphore initialization failed: $0",
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
 }
 
@@ -289,7 +287,10 @@ void Semaphore::wait()
 
         if (errno != EINTR)
         {
-            throw WaitFailed(_rep.owner);
+            throw Exception(MessageLoaderParms(
+                "Common.InternalException.SEMAPHORE_WAIT_FAILED",
+                "Semaphore wait failed: $0",
+                PEGASUS_SYSTEM_ERRORMSG_NLS));
         }
 
         // keep going if above conditions fail
@@ -329,7 +330,10 @@ Boolean Semaphore::time_wait(Uint32 milliseconds)
 
         if (retcode == -1 && errno != EAGAIN)
         {
-            throw WaitFailed(Threads::self());
+            throw Exception(MessageLoaderParms(
+                "Common.InternalException.SEMAPHORE_WAIT_FAILED",
+                "Semaphore wait failed: $0",
+                PEGASUS_SYSTEM_ERRORMSG_NLS));
         }
 
         gettimeofday(&now, NULL);
@@ -348,18 +352,11 @@ void Semaphore::signal()
 {
     if (sem_post(&_rep.sem) == -1)
     {
-        throw(IPCException(_rep.owner));
-    }
-}
-
-// return the count of the semaphore
-int Semaphore::count() const
-{
-    if (sem_getvalue(&_rep.sem, &_count) == -1)
-    {
-        throw(IPCException(_rep.owner));
+        throw Exception(MessageLoaderParms(
+            "Common.InternalException.SEMAPHORE_SIGNAL_FAILED",
+            "Failed to signal semaphore: $0",
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
-    return _count;
 }
 
 #endif /* PEGASUS_USE_POSIX_SEMAPHORE */
@@ -378,7 +375,6 @@ Semaphore::Semaphore(Uint32 initial)
     {
         initial = PEGASUS_SEM_VALUE_MAX - 1;
     }
-    _count = initial;
     _rep.owner = Threads::self();
     _rep.sem = CreateSemaphore(NULL, initial, PEGASUS_SEM_VALUE_MAX, NULL);
 }
@@ -392,13 +388,12 @@ Semaphore::~Semaphore()
 void Semaphore::wait()
 {
     DWORD errorcode = WaitForSingleObject(_rep.sem, INFINITE);
-    if (errorcode != WAIT_FAILED)
-    {
-        _count--;
-    }
-    else
+    if (errorcode == WAIT_FAILED)
     {
-        throw WaitFailed(Threads::self());
+        throw Exception(MessageLoaderParms(
+            "Common.InternalException.SEMAPHORE_WAIT_FAILED",
+            "Semaphore wait failed: $0",
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
 }
 
@@ -413,26 +408,21 @@ Boolean Semaphore::time_wait(Uint32 milliseconds)
 
     if (errorcode == WAIT_FAILED)
     {
-        throw WaitFailed(Threads::self());
+        throw Exception(MessageLoaderParms(
+            "Common.InternalException.SEMAPHORE_WAIT_FAILED",
+            "Semaphore wait failed: $0",
+            PEGASUS_SYSTEM_ERRORMSG_NLS));
     }
 
-    _count--;
     return true;
 }
 
 // increment the count of the semaphore
 void Semaphore::signal()
 {
-    _count++;
     ReleaseSemaphore(_rep.sem, 1, NULL);
 }
 
-// return the count of the semaphore
-int Semaphore::count() const
-{
-    return _count;
-}
-
 #endif /* PEGASUS_USE_WINDOWS_SEMAPHORE */
 
 PEGASUS_NAMESPACE_END
index 3be679e309a4cb9ba0dbbd42230306a0d7c348f9..ce527fd57b4ba18c013a6ee0660ca624dae0f9b6 100644 (file)
@@ -77,6 +77,7 @@ PEGASUS_NAMESPACE_BEGIN
 #if defined(PEGASUS_USE_PTHREAD_SEMAPHORE)
 struct SemaphoreRep
 {
+    int count;
     Uint32 waiters;
     pthread_mutex_t mutex;
     pthread_cond_t cond;
@@ -121,7 +122,7 @@ public:
 
     /** Blocks until this Semaphore is in a signalled state.  Interrupt
         signals are ignored.
-        @exception WaitFailed If unable to block on the semaphore.
+        @exception Exception If unable to block on the semaphore.
     */
     void wait();
 
@@ -131,8 +132,6 @@ public:
         @param milliseconds The time interval to wait (in milliseconds).
         @return True if the Semaphore has a non-zero count or is signalled
             during the specified time interval, false otherwise.
-        @exception TimeOut If the wait operation does not succeed within
-        the specified time interval.
     */
     Boolean time_wait(Uint32 milliseconds);
 
@@ -140,16 +139,11 @@ public:
     */
     void signal();
 
-    /** Return the count of the semaphore.
-    */
-    int count() const;
-
 private:
 
     Semaphore(const Semaphore& x); // Unimplemented
     Semaphore& operator=(const Semaphore& x); // Unimplemented
 
-    mutable int _count;
     mutable SemaphoreRep _rep;
     friend class Condition;
 };
index 6ffcf71e1d14d37fb964991e5cf474065f303383..5b14be42badae732b6f54e3a8fb812ee19c0bdb3 100644 (file)
@@ -329,7 +329,7 @@ void Thread::cleanup_pop(Boolean execute)
     {
         cu.reset(_cleanup.remove_front());
     }
-    catch (IPCException &)
+    catch (...)
     {
         PEGASUS_ASSERT(0);
     }
@@ -351,7 +351,7 @@ void Thread::exit_self(ThreadReturnType exit_code)
         {
             cleanup_pop(true);
         }
-        catch (IPCException &)
+        catch (...)
         {
             PEGASUS_ASSERT(0);
             break;
index e78d80f874e3cb5ce1ad771bea214eff3ef8a91a..b599ac06f0c41a01fddd0b596f0a0c13a726f5b6 100644 (file)
@@ -211,9 +211,8 @@ void deref(void *parm)
    {
       my_handle->dereference_tsd();
    }
-   catch(IPCException& e)
+   catch(...)
    {
-      e = e;
       cout << "exception dereferencing the tsd " << endl;
       abort();
    }
@@ -252,7 +251,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
    {
       my_handle->cleanup_push(exit_one , my_handle );
    }
-   catch (IPCException&)
+   catch (...)
    {
       cout << "Exception while trying to push cleanup handler" << endl;
       abort();
@@ -263,7 +262,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
       my_handle->cleanup_push(exit_two , my_handle );
    }
    
-   catch (IPCException&)
+   catch (...)
    {
       cout << "Exception while trying to push cleanup handler" << endl;
       abort();
@@ -288,7 +287,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
                             256, my_storage);              
 #endif
       }
-      catch (IPCException&)
+      catch (...)
       {
           cout << "Exception while trying to put local storage: " 
               << Threads::id(myself).buffer << endl;
@@ -299,7 +298,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
       {
           my_parm->waitRead();
       }
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to get a read lock" << endl;
          abort();
@@ -313,7 +312,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
       {
           my_handle->cleanup_push(deref , my_handle );
       }
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to push cleanup handler" << endl;
          abort();
@@ -324,7 +323,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
          my_handle->reference_tsd(keys[i % 4]);
       }
       
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to reference local storage" << endl;
          abort();
@@ -334,7 +333,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
       {
          my_handle->cleanup_pop(true);
       }
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to pop cleanup handler" << endl;
          abort();
@@ -343,7 +342,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
       {
          my_parm->unlockRead();
       }
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to release a read lock" << endl;
          abort();
@@ -353,7 +352,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL reading_thread(void *parm)
       {
           my_handle->delete_tsd(keys[i % 4]);
       }
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to delete local storage: " 
                  << Threads::id(myself).buffer << endl;
@@ -382,7 +381,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL writing_thread(void *parm)
       {
          my_parm->waitWrite();
       }
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to get a write lock" << endl;
          abort();
@@ -394,7 +393,7 @@ ThreadReturnType PEGASUS_THREAD_CDECL writing_thread(void *parm)
       {
          my_parm->unlockWrite();
       }
-      catch (IPCException&)
+      catch (...)
       {
          cout << "Exception while trying to release a write  lock" << endl;
          abort();
index 60ea2a3e6bb42081e1749a79b04a28d60947c8be..911434e2b1e15cd351f848b6cd4aa433c45e8ae1 100644 (file)
@@ -42,7 +42,6 @@
 #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/Tracer.h>
-#include <Pegasus/Common/IPCExceptions.h>
 
 #include <Pegasus/Config/ConfigManager.h>
 
@@ -184,20 +183,8 @@ void UserFileHandler::_Update(
     // at any given time
     //
 
-    try
-    {
-        if (!_mutex->timed_lock(_MUTEX_TIMEOUT))
-        {
-            throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
-                MessageLoaderParms(
-                    "Security.UserManager.UserFileHandler.TIMEOUT",
-                    "Timed out while attempting to perform the requested "
-                        "operation. Try the operation again."));
-        }
-    }
-    catch (WaitFailed&)
+    if (!_mutex->timed_lock(_MUTEX_TIMEOUT))
     {
-        // ATTN: This is an error case, not a timeout scenario
         throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
             MessageLoaderParms(
                 "Security.UserManager.UserFileHandler.TIMEOUT",
index 54b92e95c5ceeec445310ca5647bf659f2f0dd01..ff7b50c63cf967294d184c50879c6f805a5d04ce 100644 (file)
@@ -374,6 +374,42 @@ en:table {
 
         Common.InternalException.UNAUTHORIZED_ACCESS:string {"PGS00233: Unauthorized access."}
 
+        /**
+        * @note PGS00234:
+        *     Substitution {0} is an error message string
+        */
+        Common.InternalException.MUTEX_LOCK_FAILED:string {"PGS00234: Failed to acquire mutex lock: {0}"}
+
+        /**
+        * @note PGS00235:
+        *     Substitution {0} is an error message string
+        */
+        Common.InternalException.READ_LOCK_FAILED:string {"PGS00235: Failed to acquire read lock: {0}"}
+
+        /**
+        * @note PGS00236:
+        *     Substitution {0} is an error message string
+        */
+        Common.InternalException.WRITE_LOCK_FAILED:string {"PGS00236: Failed to acquire write lock: {0}"}
+
+        /**
+        * @note PGS00237:
+        *     Substitution {0} is an error message string
+        */
+        Common.InternalException.SEMAPHORE_INIT_FAILED:string {"PGS00237: Semaphore initialization failed: {0}"}
+
+        /**
+        * @note PGS00238:
+        *     Substitution {0} is an error message string
+        */
+        Common.InternalException.SEMAPHORE_WAIT_FAILED:string {"PGS00238: Semaphore wait failed: {0}"}
+
+        /**
+        * @note PGS00239:
+        *     Substitution {0} is an error message string
+        */
+        Common.InternalException.SEMAPHORE_SIGNAL_FAILED:string {"PGS00239: Failed to signal semaphore: {0}"}
+
 
         // ==========================================================
         // Messages for Exception