简体   繁体   English

并行化Java中的线程执行

[英]Parellelize a thread execution in Java

What I´m trying to do is best explained with the next imagen. 下一个图像可以最好地说明我要尝试做的事情。

说明

So I want to create a new thread to call the method send mail (T2) in the same time that the original thread (T1) finish the method execution and return the boolean. 因此,我想创建一个新线程以在原始线程(T1)完成方法执行并返回布尔值的同时调用方法send mail(T2)。

I tried to do this, but It´s doesn´t work. 我试图这样做,但是它不起作用。 I don´t know what I´m doing wrong. 我不知道我在做什么错。

Thanks in advance. 提前致谢。

您需要通过调用sendEmailThread.start();启动线程sendEmailThread.start();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM