Dispatches events which are posted to it, on one or more workers, until it's shut down. More...
#import <Application/Application.h>


Instance Methods | |
| (id) | - init |
| Initializes a run loop with room for 32 events to wait. | |
| (id) | - initWithCapacity: |
| Initializes a run loop with room for a number of events to wait. | |
| (id< NXRunLoopDelegate >) | - delegate |
| Returns the delegate, which isn't retained. | |
| (void) | - setDelegate: |
| Sets the delegate, which isn't retained. | |
| (int) | - runWithWorkers: |
| Runs, dispatching events until it's shut down. More... | |
| (BOOL) | - isRunning |
| Returns YES if it's running. | |
| (void) | - shutdownWithStatus: |
| Stops it taking events, and once those posted have been dispatched, makes runWithWorkers: return a status. More... | |
| (BOOL) | - post: |
| Posts an event, which is retained until it's been dispatched. More... | |
| (BOOL) | - perform:target: |
| Posts an event which sends a message, with no arguments, to a target. More... | |
| (BOOL) | - perform:target:argument: |
| Posts an event which sends a message, with an object as its argument, to a target. More... | |
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 | |
| (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... | |
Class Methods | |
| (NXRunLoop *) | + runningRunLoop |
| Returns the run loop which is running, or nil if none is. | |
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 | |
Protected Attributes inherited from Object | |
| Class | isa |
| A pointer to the object's class structure. More... | |
Dispatches events which are posted to it, on one or more workers, until it's shut down.
It's picofuse's sys_runloop. The thread which runs it is worker 0. On a Pico, other workers are on the other cores, and on a Mac or Linux, other threads. Every worker takes events from the same queue, in the order they were posted, so with more than one worker, events are dispatched at the same time on different cores, and what they do has to be safe for that (see Threads and mutable objects). Only one run loop runs at a time, and it can be run again once it's stopped.
Events can be posted from any thread while it runs, but not from an interrupt.
Definition at line 50 of file NXRunLoop.h.
Posts an event which sends a message, with no arguments, to a target.
The target is retained until it's been sent, if it's an NXObject.
Posts an event which sends a message, with an object as its argument, to a target.
The target and argument are retained until it's been sent, if they're NXObjects.
Posts an event, which is retained until it's been dispatched.
| - (int) runWithWorkers: | (uint8_t) | workers |
Runs, dispatching events until it's shut down.
The thread which calls this is worker 0.
| workers | The number of workers, including this one, or 0 for one on every core. More than there are cores is as many as there are. |
| - (void) shutdownWithStatus: | (int) | status |
Stops it taking events, and once those posted have been dispatched, makes runWithWorkers: return a status.
It does nothing if it isn't running.