Whenever I try to create a basic thread in Firefox (Aurora 30), it consistently crashes.
The only action it performs is executing the function "task" from the thread.
Any thoughts on what could be causing this issue?
function task(a, b) {
alert(a);
alert(b);
}
thread_job = {
init: function(func, param1, param2) {
this.func = func
this.param1 = param1
this.param2 = param2
alert("inside init");
},
run: function(){
this.func(this.param1, this.param2);
}
}
var thread = Components.classes["@mozilla.org/thread-manager;1"] // create thread
.getService(Components.interfaces.nsIThreadManager)
.newThread(0);
// Initializing the object "thread_job" with a simple function
thread_job.init(task,1,2);
// Extension code
thread.dispatch(thread_job, thread.DISPATCH_NORMAL); // Initiating the thread