1996-05-13 15:43:49 +00:00
|
|
|
/* Control of executable units within a shared virtual memory space
|
1996-02-13 15:40:05 +00:00
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
Original Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Rewritten by: Andrew McCallum <mccallum@gnu.ai.mit.edu>
|
|
|
|
Created: 1996
|
1996-02-13 15:40:05 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep Objective-C Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
1999-09-09 02:56:20 +00:00
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
1996-02-13 15:40:05 +00:00
|
|
|
*/
|
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
#ifndef __NSThread_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSThread_h_GNUSTEP_BASE_INCLUDE
|
1996-02-13 15:40:05 +00:00
|
|
|
|
1998-12-20 21:27:47 +00:00
|
|
|
#include <base/preface.h>
|
1996-05-13 15:43:49 +00:00
|
|
|
#include <objc/thr.h>
|
1996-02-13 15:40:05 +00:00
|
|
|
#include <Foundation/NSDictionary.h>
|
|
|
|
#include <Foundation/NSDate.h>
|
1997-03-03 19:51:04 +00:00
|
|
|
#include <Foundation/NSException.h>
|
1996-07-15 18:41:44 +00:00
|
|
|
#include <Foundation/NSAutoreleasePool.h> // for struct autorelease_thread_vars
|
1996-02-13 15:40:05 +00:00
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
NSInteractiveThreadPriority,
|
|
|
|
NSBackgroundThreadPriority,
|
|
|
|
NSLowThreadPriority
|
1996-02-13 15:40:05 +00:00
|
|
|
} NSThreadPriority;
|
|
|
|
|
|
|
|
@interface NSThread : NSObject
|
|
|
|
{
|
2000-04-19 12:32:38 +00:00
|
|
|
id _target;
|
|
|
|
id _arg;
|
|
|
|
SEL _selector;
|
|
|
|
BOOL _active;
|
1996-07-15 18:41:44 +00:00
|
|
|
@public
|
2000-04-19 12:32:38 +00:00
|
|
|
NSHandler *_exception_handler;
|
|
|
|
NSMutableDictionary *_thread_dictionary;
|
|
|
|
struct autorelease_thread_vars _autorelease_vars;
|
|
|
|
id _gcontext;
|
1996-02-13 15:40:05 +00:00
|
|
|
}
|
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
+ (NSThread*) currentThread;
|
|
|
|
+ (void) detachNewThreadSelector: (SEL)aSelector
|
1999-05-10 06:35:41 +00:00
|
|
|
toTarget: (id)aTarget
|
|
|
|
withObject: (id)anArgument;
|
1996-02-13 15:40:05 +00:00
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
+ (BOOL) isMultiThreaded;
|
|
|
|
- (NSMutableDictionary*) threadDictionary;
|
1996-02-13 15:40:05 +00:00
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
+ (void) sleepUntilDate: (NSDate*)date;
|
|
|
|
+ (void) exit;
|
1996-02-13 15:40:05 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
/* Notification Strings. */
|
1999-05-21 15:31:09 +00:00
|
|
|
extern NSString *NSWillBecomeMultiThreadedNotification;
|
|
|
|
#define NSBecomingMultiThreaded NSWillBecomeMultiThreadedNotification
|
|
|
|
extern NSString *NSThreadWillExitNotification;
|
|
|
|
#define NSThreadExiting NSThreadWillExitNotification
|
1996-05-13 15:43:49 +00:00
|
|
|
|
1999-04-19 14:29:52 +00:00
|
|
|
#ifndef NO_GNUSTEP
|
|
|
|
/*
|
|
|
|
* Get current thread and it's dictionary.
|
|
|
|
*/
|
|
|
|
extern NSThread *GSCurrentThread();
|
|
|
|
extern NSMutableDictionary *GSCurrentThreadDictionary();
|
|
|
|
#endif
|
|
|
|
|
1996-05-13 15:43:49 +00:00
|
|
|
#endif /* __NSThread_h_GNUSTEP_BASE_INCLUDE */
|