Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- synchronized <K, V, E> EventThread<K, V, E> getEventThread() {
- if (closed) {
- throw new IllegalStateException();
- }
- if (thread == null) {
- /* if there is no thread, then create a new one */
- thread = AccessController.doPrivileged(new PrivilegedAction<EventThread<K, V, E>>() {
- public EventThread<K, V, E> run() {
- EventThread<K, V, E> t = new EventThread<K, V, E>(threadGroup, threadName);
- return t;
- }
- });
- /* start the new thread */
- thread.start();
- }
- @SuppressWarnings("unchecked")
- EventThread<K, V, E> result = (EventThread<K, V, E>) thread;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement