#include <stdio.h>
#include <stdlib.h>
#include "toba.h"
#include "runtime.h"
#include "sthreads.h"
#include "java_lang_Thread.h"


/* java/lang/Thread currentThread ()Ljava/lang/Thread; */
Object currentThread__LY1c5()
{
    /* STATIC Method */
    init_java_lang_Thread();

    return sthread_current()->obj;
}

/* java/lang/Thread yield ()V */
Void yield__ONFaz()
{
    /* STATIC Method */
    init_java_lang_Thread();

    sthread_yield();
}

/* java/lang/Thread sleep (J)V */
Void sleep_l_up0vF(Long arg1)
{
    /* STATIC Method */
    init_java_lang_Thread();

    sthread_sleep(arg1);
}

/* synchronized java/lang/Thread start ()V */
Void sy_start__byA09(Object Harg1)
{
    struct in_java_lang_Thread *this = (struct in_java_lang_Thread *)Harg1;

    sthread_create(this);
}

/* java/lang/Thread isAlive ()Z */
Boolean isAlive__qigOl(Object Harg1)
{
    struct in_java_lang_Thread *this = (struct in_java_lang_Thread *)Harg1;

    /* if we have a TCB (threadQ field), we're alive */
    return (this->threadQ != 0);
}

/* java/lang/Thread countStackFrames ()I */
Int countStackFrames__b5LP8(Object Harg1)
/*ARGSUSED*/
{
    unimpl("java/lang/Thread/countStackFrames");
    return 0; /*NOTREACHED*/
}

/* java/lang/Thread setPriority0 (I)V */
Void setPriority0_i_Wj1u6(Object Harg1, Int arg2)
{
    struct in_java_lang_Thread *this = (struct in_java_lang_Thread *)Harg1;

    sthread_setpriority(this, arg2);
}

/* java/lang/Thread stop0 (Ljava/lang/Object;)V */
Void stop0_O_HQdmQ(Object Harg1, Object Harg2)
{
    struct in_java_lang_Thread *this = (struct in_java_lang_Thread *)Harg1;
    struct in_java_lang_Object *arg2 = (struct in_java_lang_Object *)Harg2;

    sthread_stop(this, arg2);
}

/* java/lang/Thread suspend0 ()V */
Void suspend0__vQ5d5(Object Harg1)
{
    struct in_java_lang_Thread *this = (struct in_java_lang_Thread *)Harg1;

    sthread_suspend(this);
}

/* java/lang/Thread resume0 ()V */
Void resume0__GMRlJ(Object Harg1)
{
    struct in_java_lang_Thread *this = (struct in_java_lang_Thread *)Harg1;

    sthread_resume(this);
}

