This method of the ComLib Class is similar to the java.lang.Thread.start method. The difference is that Thread.start initializes the thread as a separate single-threaded COM apartment, while startMTAThread initializes the thread inside the multi-threaded COM apartment.
This method replaces ThreadStartMTA, which did not automatically call CoInitializeEx and is now deprecated. startMTAThread calls CoInitializeEx automatically. If you use threadStartMTA and use Microsoft® J/Direct to call CoInitializeEx, the Microsoft VM detects this and tags the thread as being inside the MTA to allow proper marshaling.
public static native void startMTAThread(Thread thd);
thd | The Thread to start. |
IllegalThreadStateException if the thread was already started.
java.lang.Thread.run()
java.lang.Thread.stop()
This method was added as of versions 2925 through 3167 of the Microsoft virtual machine.