IRC Log Viewer » #firebreath » 2012-02-26

IRC Nick Time (GMT-7) Message
ch 07:02 taxilian_away: thanks for pulling the 168-fix into master
taxilian 11:02 ch: yw
thanks for the patch
Binbo 12:02 what is the best way to continuously execute function?
using while(true) is not safe
plugin surely crash
taxilian 12:02 Binbo: what exactly are you trying to do? execute a function from javacsript or in c++?
Binbo 12:02 c++
taxilian 12:02 if you need something to run continuously in c++ you need to put it in a different thread
you must *never* block the main thread in a plugin
Binbo 12:02 it crashed upon reloading the page
taxilian 12:02 if you were hoping we'd be able to provide you with useful input you're going to have to provide a lot more details about what you are doing. go re-read the lifecycle page; and keep these things in mind:
1) you must *never* block the main thread
2) any thread you start in your plugin *must* be stopped before it unloads; if it is linked to your plugin instance then it should be stopped at the latest in your shutdown function. If it is used by multiple instances it should be stopped at latest in staticdeinitialize
3) be very, very wary of creating a dependency loop with shared_ptr objects
4) this is c++; nothing is threadsafe unless you make it threadsafe. keep that in mind. (the exception is that calling things on a JSObject fireBreath makes threadsafe for you if it's standard JSAPI methods)
Binbo 12:02 i think i missed no 2
taxilian 12:02 that would do it
Binbo 12:02 i'll have a try
ZsoL 13:02 hello :]