OLD | NEW |
1 <html> | 1 <html> |
| 2 <head> |
| 3 <script src="worker_utils.js"></script> |
| 4 </head> |
2 <body> | 5 <body> |
3 <div id=result></div> | 6 <div id=result></div> |
4 <script> | 7 <script> |
5 function log(message) | 8 function log(message) |
6 { | 9 { |
7 document.getElementById("result").innerHTML += message + "<br>"; | 10 document.getElementById("result").innerHTML += message + "<br>"; |
8 } | 11 } |
9 | 12 |
10 var url = document.location.toString(); | 13 var url = document.location.toString(); |
11 var num_workers = parseInt(url.substr(url.search("count=") + 6)); | 14 var num_workers = parseInt(url.substr(url.search("count=") + 6)); |
(...skipping 19 matching lines...) Expand all Loading... |
31 workers_created++; | 34 workers_created++; |
32 log("worker " + i + " started"); | 35 log("worker " + i + " started"); |
33 if (workers_created == num_workers) { | 36 if (workers_created == num_workers) { |
34 // We've created all of our workers. Let's shut down the most recent one | 37 // We've created all of our workers. Let's shut down the most recent one |
35 // and see if we startup the queued worker. | 38 // and see if we startup the queued worker. |
36 log("Shutting down worker " + i); | 39 log("Shutting down worker " + i); |
37 worker.port.postMessage("close"); | 40 worker.port.postMessage("close"); |
38 } else if (workers_created == (num_workers+2)) { | 41 } else if (workers_created == (num_workers+2)) { |
39 // created the last worker | 42 // created the last worker |
40 log("SUCCESS: queued worker created"); | 43 log("SUCCESS: queued worker created"); |
41 document.cookie = "status=OK"; | 44 onSuccess(); |
42 } | 45 } |
43 } | 46 } |
44 } | 47 } |
45 </script> | 48 </script> |
46 | 49 |
47 </body> | 50 </body> |
48 </html> | 51 </html> |
OLD | NEW |