View Javadoc

1   // HostedThreadUtils.java, created Mon Dec 16 18:57:13 2002 by mcmartin
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.Scheduler;
5   
6   import joeq.Class.jq_Class;
7   import joeq.Runtime.Reflection;
8   
9   /***
10   * @author  John Whaley <jwhaley@alum.mit.edu>
11   * @version $Id: HostedThreadUtils.java 1456 2004-03-09 22:01:46Z jwhaley $
12   */
13  public class HostedThreadUtils implements ThreadUtils.Delegate {
14      public jq_Thread getJQThread(java.lang.Thread t) {
15          jq_Class k = joeq.Class.PrimordialClassLoader.getJavaLangThread();
16          joeq.Class.jq_InstanceField f = k.getOrCreateInstanceField("jq_thread", "Ljoeq/Scheduler/jq_Thread;");
17          return (jq_Thread)Reflection.getfield_A(t, f);
18      }    
19  }