wujun / checkthread

Automatically exported from code.google.com/p/checkthread
0 stars 0 forks source link

Inverse of @ThreadConfined #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

This request came from the checkthread email list

>>>>>>>>>>>>>>>>>>>>>>>>>

In writing Swing apps, @ThreadConfined is great to make sure some
method is running on the EDT.  But the inverse is equally important to
me: there are lots of methods that should _not_ run on the EDT, but I
don't care what thread they do run on.  In many cases I can't know the
thread name at compile time, because tasks are assigned to some thread
pool either via SwingWorker or some Executor.

So: would it be possible to add an inverse test, e.g. @ThreadConfined
(ThreadName.EDT, inverse=true) or maybe @ThreadAvoided
(ThreadName.EDT)?

Thanks,

-ds

Original issue reported on code.google.com by joe.jco...@gmail.com on 27 Apr 2009 at 1:14

GoogleCodeExporter commented 9 years ago
I second this request.  I use assert !SwingUtilities.isEventDispatchThread() in 
many
places.  A static analysis of this would be even better.

Original comment by danar...@gmail.com on 11 Oct 2009 at 9:15