Getting a thread id

Is there a way to get the thread id of a thread without passing around
the thread object? I would like to do this because I would like to
pass the thread id of a thread I created as a parameter in a rails
application.

thanks

On 7/10/06, Erich L. [email protected] wrote:

Is there a way to get the thread id of a thread without passing around
the thread object? I would like to do this because I would like to
pass the thread id of a thread I created as a parameter in a rails
application.

You can get the current Thread object via Thread.current. You can then
use the object’s id as the “thread id”. E.g.:

my_thread_id = Thread.current.object_id

Jacob F.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs