本文介绍了在由父线程创建的子线程中获取父线程名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在子线程中获取父线程名称/信息。我想这样做;我的类需要使用父线程信息来连接数据库。我的应用程序运行多线程和每个线程类连接不同的连接字符串。所以当我的父线程创建子线程时,子线程应该使用父线程类连接字符串。
如何在子线程中获取父线程信息?
谢谢,
$ b $bGökhan
解决方案
Hi,
I''m trying to get parent thread name/info in child thread. I want to do that; My classes need to use parent thread info for connect to database. My application running multithread and each threads classes connecting diffrent connection string. So when my parent threads create sub thread, sub threads should use parent thread classes connection string.
How can take parent thread informations in sub threads?
Thanks,
Gökhan
解决方案
这篇关于在由父线程创建的子线程中获取父线程名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!