pEpObjCAdapter/PEPCopyableThread.h
author Dirk Zimmermann <dz@pep.security>
Fri, 20 Sep 2019 10:01:48 +0200
branchIOSAD-141
changeset 1250 b6a4d30abd26
parent 262 9ab6513df261
permissions -rw-r--r--
IOSAD-141 Test for "hammering" the engine.
     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 
     9 #import <Foundation/Foundation.h>
    10 
    11 @class PEPCopyableThread;
    12 
    13 /**
    14  Wrapper around NSThread. Created solely to be able to use a thread as key in
    15  a NSDIctionary (e.g. conform to NSCopying).
    16  */
    17 @interface PEPCopyableThread : NSObject<NSCopying>
    18 
    19 @property (atomic, strong, readonly) NSThread * _Nullable thread;
    20 
    21 - (instancetype _Nonnull )initWithThread:(NSThread * _Nonnull)thread;
    22 
    23 /**
    24  A Boolean value that indicates whether the receiver has finished execution.
    25  @return YES if the receiver has finished execution, otherwise NO.
    26  */
    27 - (BOOL)isFinished;
    28 
    29 /**
    30  Changes the cancelled state of the receiver to indicate that it should exit.
    31  */
    32 - (void)cancel;
    33 
    34 @end