improve debug/error logging a little.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25780 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-12-24 20:51:19 +00:00
parent af737363bc
commit c6e8018204
3 changed files with 38 additions and 26 deletions

View file

@ -52,7 +52,7 @@ extern "C" {
NSMutableDictionary *_thread_dictionary;
struct autorelease_thread_vars _autorelease_vars;
id _gcontext;
void *_reserved; // For mfuture expansion
void *_reserved; // For future expansion
}
+ (NSThread*) currentThread;

View file

@ -853,13 +853,26 @@ gnustep_base_thread_callback(void)
- (void) start
{
if (_active == NO)
if (_active == YES)
{
[NSException raise: NSInternalInconsistencyException
format: @"[%@-$@] called on active thread",
NSStringFromClass([self class]),
NSStringFromSelector(_cmd)];
}
if (_cancelled == YES)
{
[NSException raise: NSInternalInconsistencyException
format: @"[%@-$@] called on cancelled thread",
NSStringFromClass([self class]),
NSStringFromSelector(_cmd)];
}
/* Make sure the notification is posted BEFORE the new thread starts.
*/
gnustep_base_thread_callback();
/* The thread must persist until if finishes executing.
/* The thread must persist until it finishes executing.
*/
RETAIN(self);
@ -874,7 +887,6 @@ gnustep_base_thread_callback(void)
[NSException raise: NSInternalInconsistencyException
format: @"Unable to detach thread (unknown error)"];
}
}
}
/**

View file

@ -196,6 +196,14 @@ static Class NSDate_class;
{
[self invalidate];
}
if (_target != nil)
{
DESTROY(_target);
}
if (_info != nil)
{
DESTROY(_info);
}
RELEASE(_date);
[super dealloc];
}
@ -253,14 +261,6 @@ static Class NSDate_class;
*/
- (void) invalidate
{
if (_target != nil)
{
DESTROY(_target);
}
if (_info != nil)
{
DESTROY(_info);
}
/* OPENSTEP allows this method to be called multiple times. */
//NSAssert(_invalidated == NO, NSInternalInconsistencyException);
_invalidated = YES;