all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
use System.Concurrency;
|
||||
use Collection;
|
||||
|
||||
bundle Default {
|
||||
class Item from Thread {
|
||||
@value : Int;
|
||||
|
||||
New(value : Int) {
|
||||
Parent();
|
||||
@value := value;
|
||||
}
|
||||
|
||||
method : public : Run(param : System.Base) ~ Nil {
|
||||
Sleep(1000 * @value);
|
||||
@value->PrintLine();
|
||||
}
|
||||
}
|
||||
|
||||
class SleepSort {
|
||||
function : Main(args : String[]) ~ Nil {
|
||||
items := Vector->New();
|
||||
each(i : args) {
|
||||
items->AddBack(Item->New(args[i]->ToInt()));
|
||||
};
|
||||
|
||||
each(i : items) {
|
||||
items->Get(i)->As(Item)->Execute(Nil);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue