Threading Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • romcab
    New Member
    • Sep 2007
    • 108

    Threading Problem

    Hi guys,

    I'm currently studying threading using C#.net and I encountered a problem on how to call method with parameters inside a ThreadStart class. Below is my sample code:

    // this where i got error; it says Method name expected
    Thread t1 = new Thread(new ParameterizedTh readStart(Go(tr ue)));

    t1.start();

    static void Go(bool b)
    {
    Console.WriteLi ne(upper ? "hello" : "HELLO");
    }
  • Bremanand
    New Member
    • Jul 2006
    • 29

    #2
    Hi,
    Try this...

    Thread t1 = new Thread(new ParameterizedTh readStart(Go));
    t1.start(true);

    static void Go(object b)
    {
    Console.WriteLi ne(upper ? "hello" : "HELLO");
    }

    Comment

    Working...