text
stringlengths
1
330k
float progress() const;
Returns the task's progress. The value will be between 0.0 (just started) and 1.0 (completed).
void reset();
Sets the task's progress to zero and clears the cancel flag.
run virtual
void run();
Calls the task's runTask() method and notifies the owner of the task's start and completion.
See also: Poco::Runnable::run()
runTask virtual
virtual void runTask() = 0;
Do whatever the task needs to do. Must be overridden by subclasses.
state inline
TaskState state() const;
Returns the task's current state.
getOwner protected inline
TaskManager * getOwner() const;
Returns the owner of the task, which may be NULL.
postNotification protected virtual
virtual void postNotification(
    Notification * pNf
Posts a notification to the task manager's notification center.
A task can use this method to post custom notifications about its progress.
setOwner protected
void setOwner(
    TaskManager * pOwner
Sets the (optional) owner of the task.
setProgress protected
void setProgress(
    float progress
Sets the task's progress. The value should be between 0.0 (just started) and 1.0 (completed).
setState protected
void setState(
    TaskState state
Sets the task's state.
sleep protected
bool sleep(
    long milliseconds
Suspends the current thread for the specified amount of time.
If the task is cancelled while it is sleeping, sleep() will return immediately and the return value will be true. If the time interval passes without the task being cancelled, the return value is false.
A Task should use this method in favor of Thread::sleep().
Next Previous Contents
2. Syntax used
2.1 Function Syntax
When speaking about a function, we write:
"function_name [ file location . extension ]"
For example:
"schedule [kernel/sched.c]"
tells us that we talk about
function retrievable from file
[ kernel/sched.c ]
Note: We also assume /usr/src/linux as the starting directory.
2.2 Indentation
Indentation in source code is 3 blank characters.
2.3 InterCallings Analysis
We use the"InterCallings Analysis "(ICA) to see (in an indented fashion) how kernel functions call each other.
For example, the sleep_on command is described in ICA below:
|init_waitqueue_entry --
|__add_wait_queue | enqueuing request
|list_add |
|__list_add --
|schedule --- waiting for request to be executed
|__remove_wait_queue --
|list_del | dequeuing request
|__list_del --
sleep_on ICA
The indented ICA is followed by functions' locations:
Note: We don't specify anymore file location, if specified just before.
In an ICA a line like looks like the following
function1 -> function2
means that < function1 > is a generic pointer to another function. In this case < function1 > points to < function2 >.
When we write:
it means that < function > is not a real function. It is a label (typically assembler label).
In many sections we may report a ''C'' code or a ''pseudo-code''. In real source files, you could use ''assembler'' or ''not structured'' code. This difference is for learning purposes.
PROs of using ICA
The advantages of using ICA (InterCallings Analysis) are many:
CONTROs of using ICA
As all theoretical models, we simplify reality avoiding many details, such as real source code and special conditions.
Next Previous Contents
Forgot your password?
User Journal
Journal: A Cure Worse than the Disease: Amending the Constitution vs. Citizens United
Journal by einhverfr
Recently a set of six senators have proposed a Constitutional Amendment to overturn the controversial Supreme Court case of Citizens United v. FEC which held that corporations were allowed to make unlimited expenditures with regard to elections provided that those were independent expenditures, not coordinated with can...
The Citizens United case overturned two previous Supreme Court cases, McConnel v. FEC (which was a case the court evidently had trouble drawing lines over given the fact that 9 justices produced 8 opinions, and pieces of four of the opinions commanded a majority of the court), and Austin v. Michigan Chamber of Commerce...
Before we get into the Constitutional Amendment and why everyone, on both sides of this issue, should be opposed to it, it's worth noting that the questions of first amendment law in election finance cases seeks to balance two competing interests. The first is to ensure that the people can write and publish on politica...
Indeed the concern over freedom of the press was at the core of Citizens United. Surely when Alito asked S. G. Malcolm Stewart if the government could Constitutionally ban books, he had no idea that the only answer S. G. Stewart could give would be "yes" (an answer repeated by S. G. Kagan at rehearing, see the same lin...
Citizens United was hailed as a major First Amendment victory by the ACLU, and many other organizations which work on First Amendment issues, and by major First Amendment scholars such as Eugene Volokh. However, many others have seen it as a doorway to corporate tampering with our elections.
However, for any controversy, there are solutions that are far worse than the cure. This is one of them. The relevant portion of the proposed Amendment is:
SECTION1. Congress shall have power to regulate the raising and spending of money and in kind equivalents with respect to Federal elections, including through setting limits onâ" ...
(2) the amount of expenditures that may be made by, in support of, or in opposition to such candidates.
The omitted paragraph 1 allows the government to regulate gifts and donations to candidates, something already within the power of the government. Section 2 grants identical powers to the states.
Now, it's important to note what is covered under Section 1 paragraph 2. In essence any money spent communicating a message on an election for or against a candidate in any way falls under government power. Presumably this could include purchasing gas to go to a rally, publishing pamphlets, buying Obama's books to give...
In essence the proposed amendment is that we trust to Congress the ability to arbitrarily limit the freedom of the press not only by corporations but also by natural persons. Such an amendment would prevent a first amendment challenge to some laws already on the books (say, a foreigner here on a student visa publishes ...
This proposed Constitutional Amendment then goes well beyond repealing Citizens United in that it takes away Constitutional protections that each of us enjoy.
Now, the subject of independent expenditures is a controversial one. However, given that only defenders of Citizens United have offered any data defending their side, I am forced to at least tentatively conclude that the ACLU is right on this one. However for the purpose of the rest of this post, I will assume that thi...
If the problem is a concentration of power over spending in our elections, it seems to me unwise to further concentrate that power in the hands of the state. Instead it would seem to me that granting power to Congress to curb the worst abuses only, while preserving the power of the common man would be preferable. In th...
In the end, it's easy to get whipped up into a frenzy and believe that because we must do something that this must be done. This is unfortunately common. We see on the other side of our politics, amendments to state Constitutions which forbid state judges from using foreign laws to inform decisions, forgetting that in ...
Every American should be opposed to this amendment. Those who oppose Citizens United and seek to overturn it should insist that the amendment to do so be narrow. Those who support it should listen to the others but make sure their concerns are addressed.
Journal: LedgerSMB 1.3.0 -- Why it's cool
Journal by einhverfr