You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
808 B

  1. //
  2. // PEPCopyableThread.h
  3. // pEpObjCAdapter
  4. //
  5. // Created by Andreas Buff on 06.10.17.
  6. // Copyright © 2017 p≡p. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class PEPCopyableThread;
  10. /**
  11. Wrapper around NSThread. Created solely to be able to use a thread as key in
  12. a NSDIctionary (e.g. conform to NSCopying).
  13. */
  14. @interface PEPCopyableThread : NSObject<NSCopying>
  15. @property (atomic, strong, readonly) NSThread * _Nullable thread;
  16. - (instancetype _Nonnull )initWithThread:(NSThread * _Nonnull)thread;
  17. /**
  18. A Boolean value that indicates whether the receiver has finished execution.
  19. @return YES if the receiver has finished execution, otherwise NO.
  20. */
  21. - (BOOL)isFinished;
  22. /**
  23. Changes the cancelled state of the receiver to indicate that it should exit.
  24. */
  25. - (void)cancel;
  26. @end