no-threads.cc 878 Bytes
Newer Older
Tom Tromey committed
1 2
// no-thread.cc - Implementation of `no threads' threads.

3
/* Copyright (C) 1998, 1999, 2001  Free Software Foundation
Tom Tromey committed
4 5 6 7 8 9 10 11 12

   This file is part of libgcj.

This software is copyrighted work licensed under the terms of the
Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
details.  */

#include <config.h>

Tom Tromey committed
13
#include <gcj/cni.h>
Tom Tromey committed
14 15
#include <jvm.h>
#include <java/lang/Thread.h>
16
#include <java/lang/InternalError.h>
Tom Tromey committed
17 18 19

java::lang::Thread *_Jv_OnlyThread = NULL;

20
_Jv_Thread_t *
21
_Jv_ThreadInitData (java::lang::Thread *thread)
Tom Tromey committed
22
{
23 24 25
  // It is ok to create a new Thread object, as long as it isn't started.
  if (_Jv_OnlyThread == NULL)
    _Jv_OnlyThread = thread;
26 27 28 29
  return NULL;
}

void
30
_Jv_ThreadStart (java::lang::Thread *, _Jv_Thread_t *, _Jv_ThreadStartFunc *)
31
{
32
  throw new java::lang::InternalError (JvNewStringLatin1 ("Thread.start called but threads not available"));
Tom Tromey committed
33
}