Daily bump.
[official-gcc.git] / libjava / quick-threads.cc
blobed7ac5eac7b82cc9758327b31e7f11e55443a384
1 // quick-threads.cc - interface between libjava and QuickThreads.
3 /* Copyright (C) 1998, 1999 Cygnus Solutions
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9 details. */
11 #include <config.h>
13 #include <cni.h>
14 #include <jvm.h>
16 #include <java/lang/Thread.h>
17 #include <java/lang/System.h>
20 // Identifier for our piece of thread-local data. Visible so that it
21 // can be used in quick-threads.h.
22 int _Jv_ThreadKey;
24 void
25 _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data,
26 _Jv_ThreadStartFunc *meth)
28 *data = coop_create ((coop_userf_t *) meth, (void *) thread,
29 thread->isDaemon());
30 coop_setspecific (*data, _Jv_ThreadKey, thread);
33 static void
34 qthrow (void *except)
36 _Jv_Throw ((java::lang::Throwable *) except);
39 // Function to destroy thread-specific data item. We just don't care.
40 static void
41 destroy_data (void *)
45 void
46 _Jv_InitThreads (void)
48 coop_init ();
49 _Jv_ThreadKey = coop_key_create (destroy_data);
50 coop_set_throw_function (qthrow);