task and immediate
Hi,
Is there a way to make a task regular? According to the
documentation, you just have to set the immediate property of the
function to 1 so the Task will be executed in the high priority
thread, but with the example bellow, it reports 1 instead of 0.
If I call the Task from a high priority message, it doesn't change
anything. Am I forgetting something?
ej
PS: this is on a mac, with latest versions of everything...
--------- save as highpriority.js ---------
var myTask = new Task(click, this);
myTask.interval = 100;
function start()
{
post("start is in the thread", max.mainthread, "n");
myTask.repeat();
}
start.immediate = 1;
function stop()
{
myTask.cancel();
}
function click()
{
post("task is in the thread", max.mainthread, "n");
outlet(0, "bang");
}
click.immediate = 1;
Warning for Windows users:
This patch crashes Max when overdrive is on, as discussed in a recent thread.
Eric