/**
 * Created by haozi on 16/2/18.
 * 用于 nw.js 多线程请求
 * (╯‵□′)╯︵┻━┻ 坑!
 *
 */


var thread={pool:{}};

thread.init=function(){
    thread.pool={};
    thread.count = 0;
}
thread.uuid=function() {
    function S4() {
        return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    }
    return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
/**
 * 创建新的线程
 * @param path string
 * @retuen new Thread
 */
thread.new=function(path){
    if(typeof (path) != "string")
     new Error("path is a String !!!!!! (╯‵□′)╯︵┻━┻");

}
thread.createWork=function(path){
    var d = new Worker(path);
    d.createDate=new Date();
    d.uuid=thread.uuid();
    return d;
}
module.exports=thread