This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: some questions about FOO-threads.cc
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: Adam Megacz <gcj at lists dot megacz dot com>
- Cc: java at gcc dot gnu dot org
- Date: Wed, 12 Dec 2001 14:57:16 +1300
- Subject: Re: some questions about FOO-threads.cc
- References: <86lmg9b4us.fsf@megacz.com>
Adam Megacz wrote:
>Can anybody briefly let me know what each of these do? The source is a
>bit sparse on documentation, and they're not mentioned in the CNI spec.
>
> _Jv_ThreadRegister
>
This is called from java.lang.Thread to register the _Jv_Thread_t data
(which is private/specific to each threads implementation but to which
java.lang.Thread has an opaque pointer to) with the threads
implementation. The implementation can use it to store the _Jv_Thread_t
in such a way that _Jv_ThreadCurrent/_Jv_ThreadCurrentData will work. In
the posix-threads implementation, we use the pthread_setspecific to
save a reference to the _Jv_Thread_t in thread-specific data.
>_Jv_ThreadUnRegister
>
Opposite of the above...
>_Jv_ThreadDestroyData
>
Opposite of _Jv_ThreadInitData. Gives your implementation a chance to
free/destroy any platform specific resources you allocated for this
thread and saved in the _Jv_Thread_t. It is called when a
java.lang.Thread is finalized.
regards
Bryce.