1 | throw new Error("Description for built in functions. Must not be included!");
|
---|
2 | /**
|
---|
3 | * @fileOverview
|
---|
4 | * Documentation of the Thread object
|
---|
5 | */
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * @class
|
---|
9 | *
|
---|
10 | * Creates a handle to a new thread.
|
---|
11 | *
|
---|
12 | * The handle can be used to
|
---|
13 | * kill the thread or be ignored. The function provided is
|
---|
14 | * executed after an initial timeout. Note that although this
|
---|
15 | * looks similar to the setTimeout in web-browsers, after started,
|
---|
16 | * the thread will not run until completion but run in parallel to
|
---|
17 | * the executed script.<P>
|
---|
18 | *
|
---|
19 | * To stop the script from within a thread, use exit(). To stop only
|
---|
20 | * execution of the thread (silently) throw a null exception
|
---|
21 | * ("throw null;"). To terminate the script with an exception
|
---|
22 | * throw a normal exception ("throw new Error("my error");").
|
---|
23 | *
|
---|
24 | * @param {Integer} timeout
|
---|
25 | * A positive integer given the initial delay in milliseconds before
|
---|
26 | * the thread is executed.
|
---|
27 | *
|
---|
28 | * @param {Function} function
|
---|
29 | * A function which is executed aftr the initial timeout.
|
---|
30 | *
|
---|
31 | * @throws
|
---|
32 | * <li> If number or type of arguments is wrong
|
---|
33 | *
|
---|
34 | * @example
|
---|
35 | * var handle = new Thread(100, function() { console.out("Hello world!"); });
|
---|
36 | * ...
|
---|
37 | * handle.kill();
|
---|
38 | */
|
---|
39 | function Thread(timeout, function)
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | *
|
---|
43 | * Kills a running thread
|
---|
44 | *
|
---|
45 | * @returns {Boolean}
|
---|
46 | * If the thread was still known, true is returned, false
|
---|
47 | * otherwise. If the thread terminated already, false is
|
---|
48 | * returned.
|
---|
49 | *
|
---|
50 | */
|
---|
51 | this.kill = function() { /* [native code] */ }
|
---|
52 | };
|
---|