home *** CD-ROM | disk | FTP | other *** search
/ NeXT Enterprise Objects Framework 1.1 / NeXT Enterprise Objects Framework 1.1.iso / NextDeveloper / Headers / foundation / NSThread.h < prev    next >
Encoding:
Text File  |  1994-11-29  |  1.4 KB  |  37 lines

  1. /*    NSThread.h
  2.     Support for initiating and controlling threads
  3.     Copyright 1994, NeXT Computer, Inc.
  4.     All rights reserved.
  5. */
  6.  
  7. #import    <foundation/NSDictionary.h>
  8. #import    <mach/cthreads.h>
  9.  
  10. @interface NSThread : NSObject  {
  11.     @private
  12.     cthread_t            cthread;
  13.     unsigned             lastStack;
  14.     NSMutableDictionary *    threadDictionary;
  15. }
  16.  
  17. + (NSThread *)currentThread;
  18.     /* the thread we are executing in */
  19.  
  20. + (void)detachNewThreadSelector:(SEL)selector toTarget:target withObject:argument;
  21.     /* creates and starts a new thread, sending the action to the target;
  22.     Actions should take one argument and yield none;
  23.     Target and argument are retained during the execution of the detached thread, then released;
  24.     If this is the first time a new thread is created (by this method), an anonymous event {eventName = "NSBecomingMultiThreaded"} is sent, to let modules protect access with locks. */
  25.  
  26. + (BOOL)isMultiThreaded;
  27.     /* Returns YES if a thread was ever detached (that thread may have died since!) */
  28.  
  29. - (NSMutableDictionary *)threadDictionary;
  30.     /* data specific to the receiving thread.  May only be accessed outside that thread before the thread is forked */
  31.  
  32. - (void)exit;
  33.     /* Terminates the receiving thread.  Same effect as returning from the initial message.  (initially restricted to be sent only from within the exiting thread).
  34.     Before exiting that thread, posts the event {eventName = "NSThreadExiting", sender = thread} */
  35.  
  36. @end
  37.