.NET/C++

【C++/CLR】Thread에 파라미터 넘겨주기

1Q74 2023. 3. 6. 08:59

1. Example

public ref class Car
{
public:
    void run(Object^ car)
    {
        // Some Code			
    }
};
Car^ car = gcnew Car();
Thread^ thread = gcnew Thread(gcnew ParameterizedThreadStart(car, &Car::run));
thread->Start(car);