Changeset 12027


Ignore:
Timestamp:
07/02/09 13:56:20 (14 years ago)
Author:
Mark Evenson
Message:

Set the name of associated the java.lang.Thread if specified.

Updated docstrings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/LispThread.java

    r11969 r12027  
    108108        this.name = name;
    109109        map.put(javaThread, this);
     110        try {
     111            javaThread.setName(name.getStringValue());
     112        } catch (ConditionThrowable ex) {
     113            Debug.trace("Failed to set thread name:");
     114      Debug.trace(ex);
     115        }
    110116        javaThread.setDaemon(true);
    111117        javaThread.start();
     
    10221028    // ### threadp
    10231029    private static final Primitive THREADP =
    1024         new Primitive("threadp", PACKAGE_EXT, true, "object")
     1030        new Primitive("threadp", PACKAGE_EXT, true, "object",
     1031          "Boolean predicate as whether OBJECT is a thread.")
    10251032    {
    10261033        @Override
     
    10331040    // ### thread-alive-p
    10341041    private static final Primitive THREAD_ALIVE_P =
    1035         new Primitive("thread-alive-p", PACKAGE_EXT, true, "thread")
     1042        new Primitive("thread-alive-p", PACKAGE_EXT, true, "thread",
     1043          "Boolean predicate whether THREAD is alive.")
    10361044    {
    10371045        @Override
     
    10511059    // ### thread-name
    10521060    private static final Primitive THREAD_NAME =
    1053         new Primitive("thread-name", PACKAGE_EXT, true, "thread")
     1061        new Primitive("thread-name", PACKAGE_EXT, true, "thread",
     1062          "Return the name of THREAD if it has one.")
    10541063    {
    10551064        @Override
     
    10751084
    10761085    // ### sleep
    1077     private static final Primitive SLEEP = new Primitive("sleep", "seconds")
     1086    private static final Primitive SLEEP = new Primitive("sleep", PACKAGE_CL, true, "seconds",
     1087               "Causes the invoking thread to sleep for SECONDS seconds.\nSECONDS may be a value between 0 1and 1.")
    10781088    {
    10791089        @Override
     
    10931103    // ### mapcar-threads
    10941104    private static final Primitive MAPCAR_THREADS =
    1095         new Primitive("mapcar-threads", PACKAGE_EXT, true)
     1105        new Primitive("mapcar-threads", PACKAGE_EXT, true, "function",
     1106          "Applies FUNCTION to all existing threads.")
    10961107    {
    10971108        @Override
     
    11131124    // ### destroy-thread
    11141125    private static final Primitive DESTROY_THREAD =
    1115         new Primitive("destroy-thread", PACKAGE_EXT, true)
     1126        new Primitive("destroy-thread", PACKAGE_EXT, true, "thread",
     1127          "Mark THREAD as destroyed.")
    11161128    {
    11171129        @Override
     
    11361148    // order is not guaranteed.
    11371149    private static final Primitive INTERRUPT_THREAD =
    1138         new Primitive("interrupt-thread", PACKAGE_EXT, true)
     1150        new Primitive("interrupt-thread", PACKAGE_EXT, true,
     1151          "thread function &rest args",
     1152          "Interrupts THREAD and forces it to apply FUNCTION to ARGS.\nWhen the function returns, the thread's original computation continues. If  multiple interrupts are queued for a thread, they are all run, but the order is not guaranteed.")
    11391153    {
    11401154        @Override
     
    11611175    // ### current-thread
    11621176    private static final Primitive CURRENT_THREAD =
    1163         new Primitive("current-thread", PACKAGE_EXT, true)
     1177        new Primitive("current-thread", PACKAGE_EXT, true, "",
     1178          "Returns a reference to invoking thread.")
    11641179    {
    11651180        @Override
     
    11721187    // ### backtrace-as-list
    11731188    private static final Primitive BACKTRACE_AS_LIST =
    1174         new Primitive("backtrace-as-list", PACKAGE_EXT, true)
     1189        new Primitive("backtrace-as-list", PACKAGE_EXT, true, "",
     1190          "Returns a backtrace of the invoking thread as a list.")
    11751191    {
    11761192        @Override
Note: See TracChangeset for help on using the changeset viewer.