Hi All,

We are developing some Mobile function related APIs for javascript users
through NPObject, everything works well expect for the callback events in
the multithreads environment. for example,

we would like to do some search operation in a new thread, and return the
search result in asynchronized way,
so, in our code, we define a JSObject *m_onMessageFound to store the user
defined funtion in setProperty operation.

*m_onMessageFound = KJS::Bindings::convertNPVariantToValue(exec, value,
root);*

when the new thread finished the search work, it will invoke the registered
function like below:

*m_onMessageFound->call(exec, NULL, args);*

The Javascript test code:

*Widget.xxx.onMessagesFound= function(var Msgs)
{
    **DEBUG("DisplayArea", "FindMessage", **"total matched "+Msgs.length**);
*
*}

var vLog = "";
function DEBUG(vDisp, sFlag, sMsg){
    if(vLog.length == 0){
        vLog = sFlag + ": " + sMsg;
    }
    else{
        vLog += "<br>" + sFlag + ": " + sMsg;
    }
    document.getElementById(vDisp).innerHTML = vLog;
}*

This will be crashed when *DEBUG()* was invoked, however, if we did not
start a new thread to search the result but invoke the callback in the same
thread, it won't crash.Or, if we remove "<br>" in the DEBUG() function, it
also won't crash.

Would anyone please provide some information on hwo to deal with these kinds
of problem.

Thanks a lot
-- 
Best regards
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to