java.lang.Thread.create()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中java.lang.Thread.create()方法的一些代码示例,展示了Thread.create()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Thread.create()方法的具体详情如下:
包路径:java.lang.Thread
类名称:Thread
方法名:create

Thread.create介绍

[英]Initializes a new, existing Thread object with a runnable object, the given name and belonging to the ThreadGroup passed as parameter. This is the method that the several public constructors delegate their work to.
[中]使用runnable对象初始化新的、现有的线程对象,该对象具有给定的名称,并且属于作为参数传递的ThreadGroup。这是几个公共构造函数将其工作委托给的方法。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread() {
  create(null, null, null, 0);
}

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(Runnable runnable) {
  create(null, runnable, null, 0);
}

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the {@code
 * ThreadGroup} passed as parameter.
 *
 * @param group
 *            {@code ThreadGroup} to which the new {@code Thread} will
 *            belong
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 * @throws IllegalThreadStateException
 *             if <code>group.destroy()</code> has already been done
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(ThreadGroup group, Runnable runnable) {
  create(group, runnable, null, 0);
}

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and the
 * name provided. The new {@code Thread} will belong to the same {@code
 * ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param threadName
 *            the name for the {@code Thread} being created
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 *
 */
public Thread(String threadName) {
  if (threadName == null) {
    throw new NullPointerException("threadName == null");
  }
  create(null, null, threadName, 0);
}

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object, the
 * given name and belonging to the {@code ThreadGroup} passed as parameter.
 *
 * @param group
 *            {@code ThreadGroup} to which the new {@code Thread} will belong
 * @param threadName
 *            the name for the {@code Thread} being created
 * @throws IllegalThreadStateException
 *             if <code>group.destroy()</code> has already been done
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(ThreadGroup group, String threadName) {
  if (threadName == null) {
    throw new NullPointerException("threadName == null");
  }
  create(group, null, threadName, 0);
}

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object, the given
 * name and belonging to the {@code ThreadGroup} passed as parameter.
 *
 * @param group
 *            ThreadGroup to which the new {@code Thread} will belong
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 * @param threadName
 *            the name for the {@code Thread} being created
 * @throws IllegalThreadStateException
 *             if <code>group.destroy()</code> has already been done
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(ThreadGroup group, Runnable runnable, String threadName) {
  if (threadName == null) {
    throw new NullPointerException("threadName == null");
  }
  create(group, runnable, threadName, 0);
}

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and name
 * provided. The new {@code Thread} will belong to the same {@code
 * ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 * @param threadName
 *            the name for the {@code Thread} being created
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(Runnable runnable, String threadName) {
  if (threadName == null) {
    throw new NullPointerException("threadName == null");
  }
  create(null, runnable, threadName, 0);
}

代码示例来源:origin: robovm/robovm

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object, the given
 * name and belonging to the {@code ThreadGroup} passed as parameter.
 *
 * @param group
 *            {@code ThreadGroup} to which the new {@code Thread} will
 *            belong
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 * @param threadName
 *            the name for the {@code Thread} being created
 * @param stackSize
 *            a stack size for the new {@code Thread}. This has a highly
 *            platform-dependent interpretation. It may even be ignored
 *            completely.
 * @throws IllegalThreadStateException
 *             if <code>group.destroy()</code> has already been done
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(ThreadGroup group, Runnable runnable, String threadName, long stackSize) {
  if (threadName == null) {
    throw new NullPointerException("threadName == null");
  }
  create(group, runnable, threadName, stackSize);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread() {
  create(null, null, null, 0);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread() {
  create(null, null, null, 0);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread() {
  create(null, null, null, 0);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread() {
  create(null, null, null, 0);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread() {
  create(null, null, null, 0);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread() {
  create(null, null, null, 0);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(Runnable runnable) {
  create(null, runnable, null, 0);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(Runnable runnable) {
  create(null, runnable, null, 0);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(Runnable runnable) {
  create(null, runnable, null, 0);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(Runnable runnable) {
  create(null, runnable, null, 0);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Constructs a new {@code Thread} with a {@code Runnable} object and a
 * newly generated name. The new {@code Thread} will belong to the same
 * {@code ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param runnable
 *            a {@code Runnable} whose method <code>run</code> will be
 *            executed by the new {@code Thread}
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 */
public Thread(Runnable runnable) {
  create(null, runnable, null, 0);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Constructs a new {@code Thread} with no {@code Runnable} object and the
 * name provided. The new {@code Thread} will belong to the same {@code
 * ThreadGroup} as the {@code Thread} calling this constructor.
 *
 * @param threadName
 *            the name for the {@code Thread} being created
 *
 * @see java.lang.ThreadGroup
 * @see java.lang.Runnable
 *
 */
public Thread(String threadName) {
  if (threadName == null) {
    throw new NullPointerException("threadName == null");
  }
  create(null, null, threadName, 0);
}

相关文章