Pumpkin, Inc.

Pumpkin User Forums

OSDestroyTask()

If you can't make Salvo do what you want it to do, post it here.

OSDestroyTask()

Postby dfleck » Fri Jun 14, 2002 10:38 am

Can I do OSDestroyTask(tcbP) before OSCreateTask(tcbP)? I don't care if OSDestroyTask(tcbP) returns an error code as long as the scheduler continues to work correctly.

------------------
Donald A. Fleck

Donald A. Fleck
dfleck
 
Posts: 28
Joined: Sun May 12, 2002 11:00 pm
Location: Breinigsville, PA, USA

Re: OSDestroyTask()

Postby aek » Fri Jun 14, 2002 10:57 am

Hi Donald.

OSDestroyTask() returns an error code if the task is already destroyed OR the task is undefined (was never created) OR it's enqueued into a type of queue from which it cannot be removed (an event's queue).

So, if you're asking whether it's OK to destroy a task before it's been created, AND it's not waiting an event etc., then yes, that shouldn't be a problem.

Perhaps this will clarify -- the scheduler does not "scan" all the tasks to see what state they're in. It only runs the most eligible task. So operations on tasks that are not eligible don't impact the dispatcher part of the scheduler.

Regards,

------------------

[This message has been edited by aek (edited June 14, 2002).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron