From 1c5685d68f1b73270fb814fe04cbb490eb90ba5f Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 15:39:19 +0000 Subject: Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library) git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/timing/ThreadPool.js | 157 --------------------------------- 1 file changed, 157 deletions(-) delete mode 100644 includes/js/dojox/timing/ThreadPool.js (limited to 'includes/js/dojox/timing/ThreadPool.js') diff --git a/includes/js/dojox/timing/ThreadPool.js b/includes/js/dojox/timing/ThreadPool.js deleted file mode 100644 index 2166a7d..0000000 --- a/includes/js/dojox/timing/ThreadPool.js +++ /dev/null @@ -1,157 +0,0 @@ -if(!dojo._hasResource["dojox.timing.ThreadPool"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.timing.ThreadPool"] = true; -dojo.provide("dojox.timing.ThreadPool"); -dojo.require("dojox.timing"); - -dojo.experimental("dojox.timing.ThreadPool"); - -// dojox.timing.Timer is included as part of _base -/******************************************************************** - This is a port of the original System.Threading.ThreadPool from - the f(m) class library. - - Donated to the Dojo toolkit by the author :) -*********************************************************************/ -(function(){ - var t=dojox.timing; - t.threadStates={ - UNSTARTED:"unstarted", - STOPPED:"stopped", - PENDING:"pending", - RUNNING:"running", - SUSPENDED:"suspended", - WAITING:"waiting", - COMPLETE:"complete", - ERROR:"error" - }; - - // Before rar says a word, we actually *use* these numbers for a purpose :) - t.threadPriorities={ - LOWEST:1, - BELOWNORMAL:2, - NORMAL:3, - ABOVENORMAL:4, - HIGHEST:5 - }; - - t.Thread=function(/* Function */fn, /* dojox.timing.threadPriorities? */priority){ - var self=this; - this.state=t.threadStates.UNSTARTED; - this.priority=priority||t.threadPriorities.NORMAL; - this.lastError=null; - this.func=fn; // for lookup purposes. - this.invoke=function(){ - self.state=t.threadStates.RUNNING; - try{ - fn(this); - self.state=t.threadStates.COMPLETE; - }catch(e){ - self.lastError=e; - self.state=t.threadStates.ERROR; - } - }; - }; - - // TODO: allow for changing of maxThreads and tick interval - t.ThreadPool=new (function(/* Number */mxthrs, /* Number */intvl){ - var self=this; - var maxThreads=mxthrs; - var availableThreads=maxThreads; - var interval=intvl; - var fireInterval=Math.floor((interval/2)/maxThreads); - var queue=[]; - var timers=new Array(maxThreads+1); - var timer=new dojox.timing.Timer(); - var invoke=function(){ - var tracker=timers[0]={}; - for(var i=0; i-1){ - queue.splice(idx,1); - return true; - } - return false; - } - - var idx=-1; - for(var i=0; i-1){ - queue.splice(idx,1); - return true; - } - return false; - }; - this.start=function(){ timer.start(); }; - this.stop=function(){ timer.stop(); }; - this.abort=function(){ - this.stop(); - for(var i=1; i