thread.c File Reference

Implementation of the Thread functions. More...

#include "thread.h"

Include dependency graph for thread.c:

Go to the source code of this file.

Functions

void cbThreadRun (JNIEnv *env, jobject jobj, jlong ptr)
 Thread run callback function.
void createThread_ (Thread *thread, void(*func)())
 Creates the Thread by getting the Java Thread-Class, the method ids and createing a new Java Thread-Object.
void createThreadC (Thread_ *thread, void(*func)())
 Function is called when working with C and calling the function createThread.
void createThreadCPP (ThreadCPP_ *thread, void(*func)())
 Function is called when working with C++ and calling the function createThread.
void deleteThread_ (Thread *thread)
 Deletes the Thread by deleting the global references.
void deleteThreadC (Thread_ *thread)
 Function is called when working with C and calling the function deleteThread.
void deleteThreadCPP (ThreadCPP_ *thread)
 Function is called when working with C++ and calling the function deleteThread.
jobject getThreadObject (Thread *thread)
 Gets the reference to the java thread object.
jint getThreadPriority (Thread *thread)
 Gets the priority of the Thread.
void initThread_ (Thread_ *thread)
 Initializes the Thread_ structure by setting the function pointers.
void setThreadPriority (Thread *thread, jint priority)
 Sets the priority of the Thread.
void sleepThread (Thread *thread, jlong milliseconds)
 Stops the current thread for the specified milliseconds.
void startThread (Thread *thread)
 Starts the Thread.
void yieldThread (Thread *thread)
 Causes the currently executing thread object to temporarily pause.


Detailed Description

Implementation of the Thread functions.

A thread is a thread of execution in a program.

Author:
Stefan Gruber
Date:
19.11.2005

Definition in file thread.c.


Function Documentation

void cbThreadRun JNIEnv *  env,
jobject  jobj,
jlong  ptr
 

Thread run callback function.

Called from a Java JNIThread Object. The function calls the function of the pointer.

Parameters:
env - Pointer to the current JNIEnv.
jobj - The object on which the function was invoked.
ptr - The address of the function to invoke.

Definition at line 89 of file thread.c.

void createThread_ Thread thread,
void(*)()  func
 

Creates the Thread by getting the Java Thread-Class, the method ids and createing a new Java Thread-Object.

Parameters:
thread - The Thread to create.
func - The function to call back.

Definition at line 115 of file thread.c.

void createThreadC Thread_ thread,
void(*)()  func
 

Function is called when working with C and calling the function createThread.

It initializes the Thread_ structure.

Parameters:
thread - A pointer to a Thread_ structure.
func - The function to call back.

Definition at line 153 of file thread.c.

void createThreadCPP ThreadCPP_ thread,
void(*)()  func
 

Function is called when working with C++ and calling the function createThread.

It initializes the ThreadCPP_ structure.

Parameters:
thread - A pointer to a ThreadCPP_ structure.
func - The function to call back.

Definition at line 140 of file thread.c.

void deleteThread_ Thread thread  ) 
 

Deletes the Thread by deleting the global references.

Parameters:
thread - A pointer to a thread.

Definition at line 163 of file thread.c.

void deleteThreadC Thread_ thread  ) 
 

Function is called when working with C and calling the function deleteThread.

Parameters:
thread - A pointer to a Thread_ structure.

Definition at line 183 of file thread.c.

void deleteThreadCPP ThreadCPP_ thread  ) 
 

Function is called when working with C++ and calling the function deleteThread.

Parameters:
thread - A pointer to a ThreadCPP_ structure.

Definition at line 173 of file thread.c.

jobject getThreadObject Thread thread  ) 
 

Gets the reference to the java thread object.

Parameters:
thread - Pointer to the thread.
Returns:
the thread object reference.

Definition at line 23 of file thread.c.

jint getThreadPriority Thread thread  ) 
 

Gets the priority of the Thread.

Parameters:
thread - Pointer to the Thread.
Returns:
the priority of the Thread.
See also:
setThreadPriority(Thread* thread, jint priority)

Definition at line 57 of file thread.c.

void initThread_ Thread_ thread  ) 
 

Initializes the Thread_ structure by setting the function pointers.

Parameters:
thread - A pointer to a Thread_ structure.

Definition at line 99 of file thread.c.

void setThreadPriority Thread thread,
jint  priority
 

Sets the priority of the Thread.

Parameters:
thread - Pointer to the Thread.
priority - The priority to set.
See also:
getThreadLabel(Thread* thread)

Definition at line 44 of file thread.c.

void sleepThread Thread thread,
jlong  milliseconds
 

Stops the current thread for the specified milliseconds.

Parameters:
thread - Pointer to the thread.
milliseconds - Milliseconds to sleep.

Definition at line 67 of file thread.c.

void startThread Thread thread  ) 
 

Starts the Thread.

Parameters:
thread - Pointer to the thread.

Definition at line 32 of file thread.c.

void yieldThread Thread thread  ) 
 

Causes the currently executing thread object to temporarily pause.

This will allow other threads to execute.

Parameters:
thread - Pointer to the thread.

Definition at line 77 of file thread.c.


Generated on Sat Nov 19 14:11:15 2005 for GrubC by  doxygen 1.4.4