public IntPtr CreateTask(TaskExecuteRange taskFunction) { IntPtr task = Native.enkiCreateTaskSet(nativeScheduler, taskFunction); if (task == IntPtr.Zero) { throw new InvalidOperationException("Task creation failed"); } return(task); }
public TaskSet CreateTask(TaskExecuteRange taskFunction) { TaskSet task = Native.enkiCreateTaskSet(nativeScheduler, taskFunction); if (!task.IsCreated) { throw new InvalidOperationException("TaskSet creation failed"); } return(task); }
internal static extern IntPtr enkiCreateTaskSet(IntPtr scheduler, TaskExecuteRange taskFunction);