Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

java_lang_Thread.c

Go to the documentation of this file.
00001 /*!
00002  * @file java_lang_Thread.c
00003  *
00004  * @brief Sample subset of @c @b java.lang.Thread native
00005  * methods
00006  *
00007  * This file contains a stub sample implementation this class.
00008  *
00009  * The full implementation of this source file should contain each and
00010  * every native method that is declared by the implmentation and it
00011  * should be stored in a shared archive along with the other classes
00012  * of this Java package's native methods.
00013  *
00014  * In this stub sample, the parameter <b><code>(JNIEnv *)</code></b>
00015  * is @e not considered.  Obviously, this is required for proper
00016  * linkage in a real implementation.
00017  *
00018  *
00019  * @section Control
00020  *
00021  * \$URL: https://svn.apache.org/path/name/java_lang_Thread.c $ \$Id: java_lang_Thread.c 0 09/28/2005 dlydick $
00022  *
00023  * Copyright 2005 The Apache Software Foundation
00024  * or its licensors, as applicable.
00025  *
00026  * Licensed under the Apache License, Version 2.0 ("the License");
00027  * you may not use this file except in compliance with the License.
00028  * You may obtain a copy of the License at
00029  *
00030  *     http://www.apache.org/licenses/LICENSE-2.0
00031  *
00032  * Unless required by applicable law or agreed to in writing,
00033  * software distributed under the License is distributed on an
00034  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
00035  * either express or implied.
00036  *
00037  * See the License for the specific language governing permissions
00038  * and limitations under the License.
00039  *
00040  * @version \$LastChangedRevision: 0 $
00041  *
00042  * @date \$LastChangedDate: 09/28/2005 $
00043  *
00044  * @author \$LastChangedBy: dlydick $
00045  *         Original code contributed by Daniel Lydick on 09/28/2005.
00046  *
00047  * @section Reference
00048  *
00049  */
00050 
00051 #include <jni.h>
00052 #include "java_lang_Thread.h"
00053 #include "jlThread.h"
00054 
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058 
00059 /*!
00060  * @brief Native implementation
00061  * of @c @b java.lang.Thread.registerNatives()
00062  *
00063  * @verbatim
00064    Class:     java_lang_Thread
00065    Method:    registerNatives
00066    Signature: ()V
00067    @endverbatim
00068  *
00069  */
00070 JNIEXPORT void JNICALL
00071     Java_java_lang_Thread_registerNatives(JNIEnv *env, jclass jc)
00072 {
00073    /* Contents to be determined */
00074 }
00075 
00076 
00077 /*!
00078  * @brief Native implementation
00079  * of @c @b java.lang.Thread.unregisterNatives()
00080  *
00081  * @verbatim
00082    Class:     java_lang_Thread
00083    Method:    unregisterNatives
00084    Signature: ()V
00085    @endverbatim
00086  *
00087  */
00088 JNIEXPORT void JNICALL
00089     Java_java_lang_Thread_unregisterNatives(JNIEnv *env, jclass jc)
00090 {
00091    /* Contents to be determined */
00092 }
00093 
00094 
00095 /*!
00096  * @brief Native implementation
00097  * of @c @b java.lang.Thread.currentThread()
00098  *
00099  * @verbatim
00100    Class:     java_lang_Thread
00101    Method:    currentThread
00102    Signature: ()Ljava/lang/Thread;
00103    @endverbatim
00104  *
00105  */
00106 JNIEXPORT jobject JNICALL
00107     Java_java_lang_Thread_currentThread(JNIEnv *env, jclass jc)
00108 {
00109     return(jlThread_currentThread(jc));
00110 }
00111 
00112 
00113 /*!
00114  * @brief Native implementation
00115  * of @c @b java.lang.Thread.yield()
00116  *
00117  * @verbatim
00118    Class:     java_lang_Thread
00119    Method:    yield
00120    Signature: ()V
00121    @endverbatim
00122  *
00123  */
00124 JNIEXPORT void JNICALL
00125     Java_java_lang_Thread_yield(JNIEnv *env, jclass jc)
00126 {
00127     return(jlThread_yield(jc));
00128 }
00129 
00130 
00131 /*!
00132  * @brief Native implementation
00133  * of @c @b java.lang.Thread.interrupt()
00134  *
00135  * @verbatim
00136    Class:     java_lang_Thread
00137    Method:    interrupt
00138    Signature: ()V
00139    @endverbatim
00140  *
00141  */
00142 JNIEXPORT void JNICALL
00143     Java_java_lang_Thread_interrupt(JNIEnv *env, jobject jo)
00144 {
00145     return(jlThread_interrupt(jo));
00146 }
00147 
00148 
00149 /*!
00150  * @brief Native implementation
00151  * of @c @b java.lang.Thread.interrupted()
00152  *
00153  * @verbatim
00154    Class:     java_lang_Thread
00155    Method:    interrupted
00156    Signature: ()Z
00157    @endverbatim
00158  *
00159  */
00160 JNIEXPORT jboolean JNICALL
00161     Java_java_lang_Thread_interrupted(JNIEnv *env, jclass jc)
00162 {
00163     return(jlThread_interrupted(jc));
00164 }
00165 
00166 
00167 /*!
00168  * @brief Native implementation
00169  * of @c @b java.lang.Thread.isInterrupted()
00170  *
00171  * @verbatim
00172    Class:     java_lang_Thread
00173    Method:    isInterrupted
00174    Signature: ()Z
00175    @endverbatim
00176  *
00177  */
00178 JNIEXPORT jboolean JNICALL
00179     Java_java_lang_Thread_isInterrupted(JNIEnv *env, jobject jo)
00180 {
00181     return(jlThread_isInterrupted(jo));
00182 }
00183 
00184 
00185 /*!
00186  * @brief Native implementation
00187  * of @c @b java.lang.Thread.sleep(long)
00188  *
00189  * @verbatim
00190    Class:     java_lang_Thread
00191    Method:    sleep
00192    Signature: (J)V
00193    @endverbatim
00194  *
00195  */
00196 JNIEXPORT void JNICALL
00197     Java_java_lang_Thread_sleep__J(JNIEnv *env, jclass jc, jlong jl)
00198 {
00199     jlThread_sleep(jc, jl);
00200 
00201     return;
00202 }
00203 
00204 
00205 /*!
00206  * @brief Native implementation
00207  * of <b><code>java.lang.Thread.sleep(long, int)</code></b>
00208  *
00209  * @verbatim
00210    Class:     java_lang_Thread
00211    Method:    sleep
00212    Signature: (JI)V
00213    @endverbatim
00214  *
00215  */
00216 JNIEXPORT void JNICALL
00217     Java_java_lang_Thread_sleep__JI(JNIEnv *env,
00218                                     jclass jc,
00219                                     jlong jl,
00220                                     jint ji)
00221 {
00222     jlThread_sleep_nanos(jc, jl, ji);
00223 
00224     return;
00225 }
00226 
00227 
00228 /*!
00229  * @brief Native implementation
00230  * of @c @b java.lang.Thread.join()
00231  *
00232  * @verbatim
00233    Class:     java_lang_Thread
00234    Method:    join
00235    Signature: ()V
00236    @endverbatim
00237  *
00238  */
00239 JNIEXPORT void JNICALL Java_java_lang_Thread_join(JNIEnv *env,
00240                                                   jobject jo)
00241 {
00242     jlThread_join4ever(jo);
00243 
00244     return;
00245 }
00246 
00247 
00248 /*!
00249  * @brief Native implementation
00250  * of @c @b java.lang.Thread.join(long)
00251  *
00252  * @verbatim
00253    Class:     java_lang_Thread
00254    Method:    join
00255    Signature: (J)V
00256    @endverbatim
00257  *
00258  */
00259 JNIEXPORT void JNICALL
00260     Java_java_lang_Thread_join__J(JNIEnv *env, jobject jo, jlong jl)
00261 {
00262     jlThread_jointimed(jo, jl);
00263 
00264     return;
00265 }
00266 
00267 
00268 /*!
00269  * @brief Native implementation
00270  * of @c @b java.lang.Thread.join()
00271  *
00272  * @verbatim
00273    Class:     java_lang_Thread
00274    Method:    join
00275    Signature: (JI)V
00276    @endverbatim
00277  *
00278  */
00279 JNIEXPORT void JNICALL
00280     Java_java_lang_Thread_join__JI(JNIEnv *env,
00281                                    jobject jo,
00282                                    jlong jl,
00283                                    jint ji)
00284 {
00285     jlThread_jointimed_nanos(jo, jl, ji);
00286 
00287     return;
00288 }
00289 
00290 
00291 /*!
00292  * @brief Native implementation
00293  * of @c @b java.lang.Thread.isAlive()
00294  *
00295  * @verbatim
00296    Class:     java_lang_Thread
00297    Method:    isAlive
00298    Signature: ()Z
00299    @endverbatim
00300  *
00301  */
00302 JNIEXPORT jboolean JNICALL
00303     Java_java_lang_Thread_isAlive(JNIEnv *env, jobject jo)
00304 {
00305     return(jlThread_isAlive(jo));
00306 }
00307 
00308 
00309 /*!
00310  * @brief Native implementation
00311  * of @c @b java.lang.Thread.start()
00312  *
00313  * @verbatim
00314    Class:     java_lang_Thread
00315    Method:    start
00316    Signature: ()V
00317    @endverbatim
00318  *
00319  */
00320 JNIEXPORT void JNICALL Java_java_lang_Thread_start(JNIEnv *env,
00321                                                    jobject jo)
00322 {
00323     jlThread_start(jo);
00324 
00325     return;
00326 }
00327 
00328 
00329 /*!
00330  * @brief Native implementation
00331  * of @c @b java.lang.Thread.countStackFrames()
00332  *
00333  * @verbatim
00334    Class:     java_lang_Thread
00335    Method:    countStackFrames
00336    Signature: ()I
00337    @endverbatim
00338  *
00339  * @deprecated <b>CAVEAT EMPTOR:</b>  This method has been deprecated
00340  *                                    in the JDK library API
00341  *                                    documentation.
00342  *
00343  */
00344 JNIEXPORT jint JNICALL
00345     Java_java_lang_Thread_countStackFrames(JNIEnv *env, jobject jo)
00346 {
00347     return(jlThread_countStackFrames(jo));
00348 }
00349 
00350 
00351 /*!
00352  * @brief Native implementation
00353  * of @c @b java.lang.Thread.holdsLock()
00354  *
00355  * @verbatim
00356    Class:     java_lang_Thread
00357    Method:    holdsLock
00358    Signature: (Ljava/lang/Object;)Z
00359    @endverbatim
00360  *
00361  */
00362 JNIEXPORT jboolean JNICALL
00363     Java_java_lang_Thread_holdsLock(JNIEnv *env, jclass jc, jobject jo)
00364 {
00365     return(jlThread_holdsLock(jc, jo));
00366 }
00367 
00368 
00369 /*!
00370  * @brief Native implementation
00371  * of @c @b java.lang.Thread.setPriority()
00372  *
00373  * @verbatim
00374    Class:     java_lang_Thread
00375    Method:    setPriority
00376    Signature: (I)V
00377    @endverbatim
00378  *
00379  */
00380 JNIEXPORT void JNICALL
00381     Java_java_lang_Thread_setPriority(JNIEnv *env, jobject jo, jint ji)
00382 {
00383     jlThread_setPriority(jo, ji);
00384 
00385     return;
00386 }
00387 
00388 
00389 /*!
00390  * @brief Native implementation
00391  * of @c @b java.lang.Thread.getPriority()
00392  *
00393  * @verbatim
00394    Class:     java_lang_Thread
00395    Method:    getPriority
00396    Signature: ()I
00397    @endverbatim
00398  *
00399  */
00400 JNIEXPORT jint JNICALL
00401     Java_java_lang_Thread_getPriority(JNIEnv *env, jobject jo)
00402 {
00403     return(jlThread_getPriority(jo));
00404 }
00405 
00406 
00407 /*!
00408  * @brief Native implementation
00409  * of @c @b java.lang.Thread.destroy()
00410  *
00411  * @verbatim
00412    Class:     java_lang_Thread
00413    Method:    destroy
00414    Signature: ()V
00415    @endverbatim
00416  *
00417  */
00418 JNIEXPORT void JNICALL
00419     Java_java_lang_Thread_destroy(JNIEnv *env, jobject jo)
00420 {
00421     jlThread_destroy(jo);
00422 
00423     return;
00424 }
00425 
00426 
00427 /*!
00428  * @brief Native implementation
00429  * of @c @b java.lang.Thread.checkAccess()
00430  *
00431  * @verbatim
00432    Class:     java_lang_Thread
00433    Method:    checkAccess
00434    Signature: ()V
00435    @endverbatim
00436  *
00437  */
00438 JNIEXPORT void JNICALL
00439     Java_java_lang_Thread_checkAccess(JNIEnv *env, jobject jo)
00440 {
00441     jlThread_checkAccess(jo);
00442 
00443     return;
00444 }
00445 
00446 
00447 /*!
00448  * @brief Native implementation
00449  * of @c @b java.lang.Thread.setDaemon()
00450  *
00451  * @verbatim
00452    Class:     java_lang_Thread
00453    Method:    setDaemon
00454    Signature: (Z)V
00455    @endverbatim
00456  *
00457  */
00458 JNIEXPORT void JNICALL
00459     Java_java_lang_Thread_setDaemon(JNIEnv *env,
00460                                     jobject jo,
00461                                     jboolean jb)
00462 {
00463     jlThread_setDaemon(jo, jb);
00464 
00465     return;
00466 }
00467 
00468 
00469 /*!
00470  * @brief Native implementation
00471  * of @c @b java.lang.Thread.isDaemon()
00472  *
00473  * @verbatim
00474    Class:     java_lang_Thread
00475    Method:    isDaemon
00476    Signature: ()Z
00477    @endverbatim
00478  *
00479  */
00480 JNIEXPORT jboolean JNICALL
00481     Java_java_lang_Thread_isDaemon(JNIEnv *env, jobject jo)
00482 {
00483     return(jlThread_isDaemon(jo));
00484 }
00485 
00486 
00487 /*!
00488  * @brief Native implementation
00489  * of @c @b java.lang.Thread.stop()
00490  *
00491  * @verbatim
00492    Class:     java_lang_Thread
00493    Method:    stop
00494    Signature: ()V
00495    @endverbatim
00496  *
00497  * @deprecated <b>CAVEAT EMPTOR:</b>  This method has been deprecated
00498  *                                    in the JDK library API
00499  *                                    documentation.
00500  *
00501  */
00502 JNIEXPORT void JNICALL
00503     Java_java_lang_Thread_stop(JNIEnv *env, jobject jo)
00504 {
00505     return(jlThread_stop(jo));
00506 }
00507 
00508 
00509 /*!
00510  * @brief Native implementation
00511  * of @c @b java.lang.Thread.suspend()
00512  *
00513  * @verbatim
00514    Class:     java_lang_Thread
00515    Method:    suspend
00516    Signature: ()V
00517    @endverbatim
00518  *
00519  * @deprecated <b>CAVEAT EMPTOR:</b>  This method has been deprecated
00520  *                                    in the JDK library API
00521  *                                    documentation.
00522  *
00523  */
00524 JNIEXPORT void JNICALL
00525     Java_java_lang_Thread_suspend(JNIEnv *env, jobject jo)
00526 {
00527     return(jlThread_suspend(jo));
00528 }
00529 
00530 
00531 /*!
00532  * @brief Native implementation
00533  * of @c @b java.lang.Thread.resume()
00534  *
00535  * @verbatim
00536    Class:     java_lang_Thread
00537    Method:    resume
00538    Signature: ()V
00539    @endverbatim
00540  *
00541  * @deprecated <b>CAVEAT EMPTOR:</b>  This method has been deprecated
00542  *                                    in the JDK library API
00543  *                                    documentation.
00544  *
00545  */
00546 JNIEXPORT void JNICALL
00547     Java_java_lang_Thread_resume(JNIEnv *env, jobject jo)
00548 {
00549     return(jlThread_resume(jo));
00550 }
00551 
00552 
00553 #ifdef __cplusplus
00554 }
00555 #endif
00556 
00557 
00558 /* EOF */
00559 

Generated on Fri Sep 30 18:48:55 2005 by  doxygen 1.4.4