To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 2374
2373  |  2375
Subject: 
Proposal: int program_running()
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 20 Mar 2002 17:20:22 GMT
Viewed: 
1674 times
  
I have noticed several places in the kernel where nb_tasks is used to see if
a program is running.  Currently, nb_tasks > 3 means that a program is
running and <= 3 means that just the kernel processes are running.

I would like to propose that the following inline function (or if necessary,
macro) be used instead.  This would likely be placed in program.h within
#ifdef CONF_PROGRAM ... #endif

inline int program_running() {
  return (nb_tasks > 3);
}

This would allow easy modification (if perhaps another kernel task was
introduced  or  a new method was developed for program tracking).

Any comments or suggestions?  I would make the patch myself, but am not
familiar with the tools to do so.

-Joe



Message has 1 Reply:
  Re: Proposal: int program_running()
 
(...) I've thought about this before but never did anything 8?( I think I'd prefer a macro, thus removing the need for #ifdef. Although you wouldn't want the #ifdef anyway, as you need to call it in the kernel, and #ifdefing it out would be rather (...) (23 years ago, 20-Mar-02, to lugnet.robotics.rcx.legos)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR