bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in NSException.m: _NSAddHandler (was: NSThread.m: GSCurrentThrea


From: Richard Frith-Macdonald
Subject: Re: bug in NSException.m: _NSAddHandler (was: NSThread.m: GSCurrentThread() doesn't create new instance)
Date: Thu, 12 Jul 2001 09:41:36 +0100

On Thursday, July 12, 2001, at 08:51 AM, Michael Scheibler wrote:


Well it's some time ago, but now I have this problem with unregistered
threads again. Actually it seems to be a bug in GNUstep's exception
handling, which uses _NSAddHandler and _NSRemoveHandler:

void
_NSAddHandler (NSHandler* handler)
{
  NSThread *thread;

  thread = GSCurrentThread();
  // didn't call GSRegisterCurrentThread()
  // -> thread is NULL
  handler->next = thread->_exception_handler;
  thread->_exception_handler = handler;
}

void
_NSRemoveHandler (NSHandler* handler)
{
  NSThread *thread;

  thread = GSCurrentThread();
  // still didn't call GSRegisterCurrentThread()
  // -> thread most likely will be NULL, too
  thread->_exception_handler = thread->_exception_handler->next;
}

I don't understand the nature of the problem.
If you use non-GNUstep threads, it's your responsibility to register
those threads before using any other GNUstep code, so exception
handlers shouldn't register them.

Are you worried about the possibility of an exception being raised
when you call GSRegisterCurrentThread()?  I guess these methods really
should check to see if a thread exists and raise an exception (to be
handled by the default handler) if it doesn't.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]