Runs methods in threads, and provides information about cores. More...
#import <Foundation/Foundation.h>


Class Methods | |
| (void) | + sleepForDuration: |
| Pauses the calling thread. More... | |
| (void) | + halt |
| Stops the program, and doesn't return. More... | |
| (uint8_t) | + numberOfCores |
| Returns the number of cores. | |
| (uint8_t) | + coreNumber |
| Returns the number of the core which the calling thread is running on, starting with zero. More... | |
| (BOOL) | + run:target: |
| Runs a method in a new thread. More... | |
| (BOOL) | + run:target:core: |
| Runs a method in a new thread on a specific core. More... | |
| (BOOL) | + run:target:argument: |
| Runs a method which has an argument in a new thread. More... | |
| (BOOL) | + run:target:argument:core: |
| Runs a method which has an argument in a new thread on a specific core. More... | |
Class Methods inherited from NXObject | |
| (id) | + alloc |
| Allocates a new instance in the default zone, or if there isn't one, with sys_calloc(). More... | |
| (id) | + allocWithZone: |
| Allocates a new instance in a specific zone. More... | |
| (id) | + new |
| Allocates and initializes a new instance, as [[cls alloc] init] does. More... | |
| (NXString *) | + description |
| Returns the name of the class. | |
Class Methods inherited from Object | |
| (void) | + initialize |
| Performs one-time initialization for the class. More... | |
| (Class) | + class |
| Returns the class object. More... | |
| (Class) | + superclass |
| Returns the superclass of the class. More... | |
| (const char *) | + name |
| Returns the name of the class. More... | |
| (BOOL) | + conformsTo: |
| Checks if the class conforms to a protocol. More... | |
Additional Inherited Members | |
Instance Methods inherited from NXObject | |
| (void) | - dealloc |
| Frees the instance. More... | |
| (NXZone *) | - zone |
| Returns the zone in which the instance was allocated. More... | |
| (id) | - retain |
| Increases the retain count of the receiver. More... | |
| (void) | - release |
| Decreases the retain count of the receiver. More... | |
| (id) | - autorelease |
| Releases the receiver later, when the current autorelease pool of the thread is drained. More... | |
| (id) | - copy |
| Returns a copy which can't be changed by anything else, which the caller owns and has to release. More... | |
| (uintptr_t) | - hash |
| Returns a number for the object, which is the same for objects which are equal by isEqual:. More... | |
| (NXString *) | - description |
| Returns a string which describes the instance, for logging. More... | |
Instance Methods inherited from Object | |
| (id) | - init |
| Initialize the instance, after allocation. More... | |
| (Class) | - class |
| Returns the class of the instance. More... | |
| (Class) | - superclass |
| Returns the superclass of the instance. More... | |
| (BOOL) | - isEqual: |
| Compares the receiver to another object for equality. More... | |
| (BOOL) | - isKindOfClass: |
| Returns a Boolean value that indicates whether the receiver is an instance of a given class. More... | |
| (BOOL) | - conformsTo: |
| Checks if the receiver's class conforms to a protocol. More... | |
Instance Methods inherited from <ObjectProtocol> | |
| (BOOL) | - respondsToSelector: |
| Checks if the receiver responds to a selector. More... | |
Protected Attributes inherited from Object | |
| Class | isa |
| A pointer to the object's class structure. More... | |
Runs methods in threads, and provides information about cores.
A Pico has one thread for each core: only the thread on core 0 can run a method in another thread, which is on core 1, and only if nothing is already running there.
Definition at line 18 of file NXThread.h.
| + (uint8_t) coreNumber |
Returns the number of the core which the calling thread is running on, starting with zero.
Other than on a Pico, that can change at any time.
| + (void) halt |
Stops the program, and doesn't return.
On a Pico, it's only the calling core which stops, and the other carries on. On other systems the program is aborted.
Runs a method in a new thread.
| selector | The selector for the method, which has no arguments. What it returns isn't used, and can't be a struct, a union, a complex number or a long double. |
| target | The object or class which has the method. If it's an NXObject, it's retained until the method returns. |
The method has its own autorelease pool.
Runs a method which has an argument in a new thread.
| selector | The selector for the method, which has one argument, an object. |
| target | The object or class which has the method. |
| argument | The argument, which may be nil. If it's an NXObject, it's retained until the method returns. |
Otherwise this is the same as run:target:.
Runs a method which has an argument in a new thread on a specific core.
| selector | The selector for the method, which has one argument, an object. |
| target | The object or class which has the method. |
| argument | The argument, which may be nil. If it's an NXObject, it's retained until the method returns. |
| core | The number of the core. |
Runs a method in a new thread on a specific core.
| selector | The selector for the method, which has no arguments. |
| target | The object or class which has the method. |
| core | The number of the core. |
Otherwise this is the same as run:target:.
| + (void) sleepForDuration: | (NXDuration) | duration |
Pauses the calling thread.
| duration | How long to pause, which is rounded up to a millisecond. It doesn't if this is zero or negative. |