mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
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:
parent
af737363bc
commit
c6e8018204
3 changed files with 38 additions and 26 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -875,7 +888,6 @@ gnustep_base_thread_callback(void)
|
|||
format: @"Unable to detach thread (unknown error)"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the thread dictionary. This dictionary can be used to store
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue