RtfwCreateScheduledProcess
RtfwCreateScheduledProcess creates a new scheduled process to start with the real-time Subsystem.
Syntax
bool RtfwCreateScheduledProcess(
[out] PRTFW_SCHEDULED_PROCESS ScheduledProc,
[in] int order
);
Parameters
[out] ScheduledProc
Pointer to the RTFW_SCHEDULED_PROCESS structure created by this function.
[in] order
The order in which this scheduled process will be executed. Using a value that is greater than the sum of scheduled processes currently in existence or using RTFW_SCHEDULED_PROCESS_LAST_ORDER will place this new scheduled process at the end of the list.
Return Value
If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. Call GetLastError to obtain an error code.
Possible error codes:
| Error code | Meaning |
|---|---|
|
RT_ERROR_INVALID_AFFINITY_MASK |
An invalid affinity mask was specified. |
|
RT_ERROR_INVALID_IDEAL_PROCESSOR |
An invalid ideal processor was specified. |
|
ERROR_INVALID_PARAMETER |
One of the parameters of this function is NULL, or a field within the structure is invalid. |
|
RT_ERROR_STRUCTURE_TOO_SMALL |
The member Size of a structure is too small. |
|
RT_ERROR_SCHEDULED_PROCESS_LOCK_FAILURE |
Failed to obtain the lock to serialize starting/stopping the wRTOS Subsystem. |
Remarks
This function has locking to allow for thread safety. It shares a lock with all other scheduled process functions.
The ScheduledID field within the structure will be changed to the identifier it was given upon success of this function.
Requirements
| Minimum supported version | Header | Library |
|---|---|---|
|
wRTOS 1.0 SDK |
RtfwApi.h |
RtfwApi.lib |
See Also: