home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Examples / Foundation / MultiThreadedDO / ThreadSafeQueue.h < prev    next >
Text File  |  1996-04-12  |  551b  |  20 lines

  1. /* ThreadSafeQueue.h created by blaine on Mon 01-Apr-1996 */
  2.  
  3. /* A dirt simple queue - it doesn't copy, doesn't enumerate, doesn't code, ... */
  4.  
  5. #import <Foundation/Foundation.h>
  6.  
  7. @interface ThreadSafeQueue : NSObject {
  8.     NSLock *lock;
  9.     NSMutableArray *array;
  10. }
  11. + instance;
  12. - headItem;    // remove and return the item at the head (nil if empty)
  13. - tailItem;    // remove and return the item at the tail (nil if empty)
  14. - (void)insertItem:obj;    // inserts at head
  15. - (void)appendItem:obj; // appends at tail
  16. - (unsigned)count;
  17. - (NSArray *)snapshot;
  18.  
  19. @end
  20.