Thread java synchronous execution method

//Send activation email

//sendEmail(); Change the sequentially executed code to a new thread, the content below. will be executed synchronously

new Thread(){

 public void run() {

 try {

sendEmail ();

} catch (Exception e) {

e.printStackTrace ();

}

 }

}.start();

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326888611&siteId=291194637