Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322495

Summary: Support of multiple threadings
Product: [Technology] XWT Reporter: Yves YANG <yves.yang>
Component: CoreAssignee: Project Inbox <e4.xwt-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Yves YANG CLA 2010-08-12 05:39:15 EDT
During the Spring integration, Angelo has reported a problem of multiple threadings in XWT (Bug 320405). The following code raises an exception: 

org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:4083)

public static void main(String[] args) {

        new Thread() {
            @Override
            public void run() {

                URL url = CLRFactoryNamespace.class
                        .getResource(CLRFactoryNamespace.class.getSimpleName()
                                + IConstants.XWT_EXTENSION_SUFFIX);
                try {
                    XWT.open(url);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();

        new Thread() {
            @Override
            public void run() {

                URL url = CLRFactoryNamespace.class
                        .getResource(CLRFactoryNamespace.class.getSimpleName()
                                + IConstants.XWT_EXTENSION_SUFFIX);
                try {
                    XWT.open(url);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }
Comment 1 Yves YANG CLA 2010-08-12 06:37:49 EDT
The modification is committed with a testcase -> 20100812