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

Bug 271089

Summary: Display#getSyncThread() is missing
Product: [RT] RAP Reporter: Dmitry Pryadkin <drpadawan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: drpadawan
Version: 1.0   
Target Milestone: 1.3 M7   
Hardware: All   
OS: All   
URL: http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.technology.rap/msg03766.html
Whiteboard:

Description Dmitry Pryadkin CLA 2009-04-03 03:20:33 EDT
Please implement Display#getSyncThread()
Comment 1 RĂ¼diger Herrmann CLA 2009-04-03 05:48:22 EDT
Not sure if this will make it into 1.2
But from what I understand, it should be easy to work around the missing method in both RCP and RAP:
    final Thread syncThread = Thread.currentThread();
    display.syncExec( new Runnable() {
      public void run() {
        System.out.println( "syncThread: " + syncThread );
        // do something in UI thread
      }
    } );
Comment 2 Dmitry Pryadkin CLA 2009-04-03 06:13:52 EDT
Indeed it's easy.

However in my case I have to check Jobs in JobManager and take decisions if a job is locked on UIThread.

Comment 3 RĂ¼diger Herrmann CLA 2009-04-05 12:56:39 EDT
(In reply to comment #2)
> [ ... ]
> However in my case I have to check Jobs in JobManager and take decisions if a
> job is locked on UIThread.
I don't quite understand. Does that mean that the proposed workaround doesn't
work for you? If so, why?
The actual getSyncThread() implementation wouldn't do differently.
Comment 4 Dmitry Pryadkin CLA 2009-04-06 03:01:53 EDT
(In reply to comment #3)

> I don't quite understand. Does that mean that the proposed workaround doesn't
> work for you? If so, why?

The proposed workaround is not applicable to my case.

   final Job [] jobs = jobManager.find(connection);
   for (Job job : jobs)
   {
       final Thread thread = job.getThread();

       if (thread != null
           && thread == currentDisplay.getSyncThread())
       {
             // job is currently running and is locking the currentDisplay
       }
   }



> The actual getSyncThread() implementation wouldn't do differently.
> 

I don't argue.
Comment 5 Ralf Sternberg CLA 2010-04-27 09:59:27 EDT
Implemented in CVS HEAD.