no-threads.cc 878 B

12345678910111213141516171819202122232425262728293031323334
  1. // no-thread.cc - Implementation of `no threads' threads.
  2. /* Copyright (C) 1998, 1999, 2001 Free Software Foundation
  3. This file is part of libgcj.
  4. This software is copyrighted work licensed under the terms of the
  5. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  6. details. */
  7. #include <config.h>
  8. #include <gcj/cni.h>
  9. #include <jvm.h>
  10. #include <java/lang/Thread.h>
  11. #include <java/lang/InternalError.h>
  12. java::lang::Thread *_Jv_OnlyThread = NULL;
  13. _Jv_Thread_t *
  14. _Jv_ThreadInitData (java::lang::Thread *thread)
  15. {
  16. // It is ok to create a new Thread object, as long as it isn't started.
  17. if (_Jv_OnlyThread == NULL)
  18. _Jv_OnlyThread = thread;
  19. return NULL;
  20. }
  21. void
  22. _Jv_ThreadStart (java::lang::Thread *, _Jv_Thread_t *, _Jv_ThreadStartFunc *)
  23. {
  24. throw new java::lang::InternalError (JvNewStringLatin1 ("Thread.start called but threads not available"));
  25. }