Overview
Features
Download
Documentation
Community
Add-Ons & Services

Bug in Mutex_WIN32.h?

Please post support and help requests here.

Bug in Mutex_WIN32.h?

Postby hersto » 10 Nov 2007, 11:09

Hi,

i found these lines in Mutex_WIN32.h, Poco 1.3.1. Shouldn't the throw statement be moved inside the catch(.) statement?


inline bool MutexImpl::tryLockImpl() -----------{ ----------- try ----------- { ----------- return TryEnterCriticalSection(&_cs) == TRUE; -----------} -----------catch (...) -----------{ -----------} -----------throw SystemException("cannot lock mutex"); -----------}

Another question: i didn't find a bug report page for Poco. Is there none?

Yet another question, how can i post source code properly?

hersto
hersto
 
Posts: 5
Joined: 18 Oct 2007, 12:42
Location: Germany

Re: Bug in Mutex_WIN32.h?

Postby alex » 10 Nov 2007, 16:07

> i found these lines in Mutex_WIN32.h, Poco 1.3.1. Shouldn't the throw statement be moved inside the catch(.) statement?

It doesn't really make difference, since after a successful call to TryEnterCriticalSection() function will return. A call to TryEnterCriticalSection() that throws will get caught. At that point, whether you throw from inside catch or later makes no difference.

> Another question: i didn't find a bug report page for Poco. Is there none?

Sure there is. Try here.

> Yet another question, how can i post source code properly?

Put it inside ~np~
Code: Select all
 and
~/np~ tags, like this:
Code: Select all

inline bool MutexImpl::tryLockImpl()
{
   try
   {
      return TryEnterCriticalSection(&_cs) == TRUE;
   }
   catch (...)
   {
   }
   throw SystemException("cannot lock mutex");
}

Check Tikiwiki documentation for complete reference.

Alex
alex
 
Posts: 1132
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron