OSDN Git Service

This is still broken. Do not use it yet
[pf3gnuchains/gcc-fork.git] / libjava / no-threads.cc
1 // no-thread.cc - Implementation of `no threads' threads.
2
3 /* Copyright (C) 1998, 1999  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 #include <config.h>
12
13 #include <gcj/cni.h>
14 #include <jvm.h>
15 #include <java/lang/Thread.h>
16
17 java::lang::Thread *_Jv_OnlyThread = NULL;
18
19 _Jv_Thread_t *
20 _Jv_ThreadInitData (java::lang::Thread * thread)
21 {
22   // Don't use JvAssert, since we want this to fail even when compiled
23   // without assertions.
24   if (_Jv_OnlyThread)
25     JvFail ("only thread already running");
26   _Jv_OnlyThread = thread;
27   return NULL;
28 }
29
30 void
31 _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *,
32                  _Jv_ThreadStartFunc *meth)
33 {
34   JvFail ("Thread.start called but threads not available");
35 }