multithreading - Multi-threading C# 2.0 confusion -


i trying figure out how multi-thread application. stuck trying find entry point start thread.

the thread trying start : plugin.fireoncommand(this, newargs);

... pluginbase plugin = plugins.getplugin(commands.getinternalname(command)); plugin.fireoncommand(this, newargs); ... 

the fireoncommand method is:

 public void fireoncommand(botshell bot, commandargs args) 

i not having luck using parameterizedthreadstart or threadstart, can't seem syntax correct.

edit: tried both

thread newthread =    new thread(new parameterizedthreadstart(plugin.fireoncommand(this, newargs)));  

and

thread newthread =    new thread(new threadstart(plugin.fireoncommand(this, newargs))); 

here example code:

class botargs {     public botshell bot;     public commandargs args; }  public void fireoncommand(botshell bot, commandargs args) {     var botargs = new botargs {         bot = bot,         args = args     };     var thread = new thread (handlecommand);     thread.start (botargs); }  void handlecommand (botargs botargs) {     var botshell = botargs.bot;     var commandargs = botargs.args;     //here goes work } 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -