views:

100

answers:

1

Hello, I have a extension that uses multithreading using worker thread as shown here . Whenever worker thread returns value to main thread, I am updating UI and I am starting that thread again because I want to continuously execute that operation. I cannot use setInterval because inside thread is a call to C++ XPCOM component function which does socket recv blocking call and that reception may not be periodic.

Now when I close firefox, firefox window is closed but the firefox process keeps on running and consuming 99% CPU. So I always need to close that process forcefully.

How to close that process completely. Extension is in overlay like this

<overlay id="helloworldOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
<statusbar id="status-bar">
.
.
.
</statusbar>
</overlay>
+4  A: 

Use the terminate method: https://developer.mozilla.org/En/DOM/Worker#Methods

Pedro Ladaria
terminate.. where do I call it, is it present in javascript, or any service?
Xinus
https://developer.mozilla.org/En/DOM/Worker it's a worker method (like postMessage)
Pedro Ladaria