+/* thread_is_interrupted *******************************************************
+
+ Check if the given thread has been interrupted.
+
+ ARGUMENTS:
+ t ... the thread to check
+
+ RETURN VALUE:
+ true, if the given thread had been interrupted
+
+*******************************************************************************/
+
+bool thread_is_interrupted(threadobject *t)
+{
+ /* We need the mutex because classpath will call this function when
+ a blocking system call is interrupted. The mutex ensures that it will
+ see the correct value for the interrupted flag. */
+
+ t->waitmutex->lock();
+ bool interrupted = t->interrupted;
+ t->waitmutex->unlock();
+
+ return interrupted;
+}
+
+
+/* thread_set_interrupted ******************************************************
+
+ Set the interrupted flag to the given value.
+
+ ARGUMENTS:
+ interrupted ... value to set
+
+*******************************************************************************/
+
+void thread_set_interrupted(threadobject *t, bool interrupted)
+{
+ t->waitmutex->lock();
+ t->interrupted = interrupted;
+ t->waitmutex->unlock();
+}
+
+/* thread_handle_set_priority **************************************************
+
+ Calls threads_set_thread_priority for the threadobject associated
+ with the thread indicated by handle th, while holding the thread
+ list lock.
+
+*******************************************************************************/
+
+void thread_handle_set_priority(java_handle_t *th, int priority)
+{
+ threadobject *t = thread_get_thread(th);
+ /* For GNU classpath, this should not happen, because both
+ setPriority() and start() are synchronized. */
+ assert(t != 0);
+ threads_set_thread_priority(t->tid, priority);
+}
+
+/* thread_handle_is_interrupted ************************************************
+
+ Calls thread_is_interrupted for the threadobject associated with
+ the thread indicated by handle th, while holding the thread list
+ lock.
+
+*******************************************************************************/
+
+bool thread_handle_is_interrupted(java_handle_t *th)
+{
+ threadobject *t = thread_get_thread(th);
+ return t ? thread_is_interrupted(t) : false;
+}
+
+/* thread_handle_interrupt *****************************************************
+
+ Calls threads_thread_interrupt for the threadobject associated with
+ the thread indicated by handle th, while holding the thread list
+ lock.
+
+*******************************************************************************/
+
+void thread_handle_interrupt(java_handle_t *th)
+{
+ threadobject *t = thread_get_thread(th);
+ /* For GNU classpath, this should not happen, because both
+ interrupt() and start() are synchronized. */
+ assert(t != 0);
+ threads_thread_interrupt(t);
+}
+
+/* thread_handle_get_state *****************************************************
+
+ Calls cacaothread_get_state for the threadobject associated with
+ the thread indicated by handle th, while holding the thread list
+ lock.
+
+*******************************************************************************/
+
+int thread_handle_get_state(java_handle_t *th)
+{
+ threadobject *t = thread_get_thread(th);
+ return t ? cacaothread_get_state(t) : THREAD_STATE_NEW;
+}
+