MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3 / wait_thread_short

Method wait_thread_short

javacli/OpenVPNClientThread.java:119–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117 // This method will give the thread one second to
118 // exit and will abandon it after this time.
119 public void wait_thread_short() {
120 final int wait_millisecs = 5000; // max time that we will wait for thread to exit
121 Thread th = thread;
122 if (th != null) {
123 try {
124 th.join(wait_millisecs);
125 }
126 catch (InterruptedException e) {
127 }
128
129 // thread failed to stop?
130 if (th.isAlive()) {
131 // abandon thread and deliver our own status object to instantiator.
132 ClientAPI_Status status = new ClientAPI_Status();
133 status.setError(true);
134 status.setMessage("CORE_THREAD_ABANDONED");
135 call_done(status);
136 }
137 }
138 }
139
140 // Wait for worker thread to complete; to stop thread,
141 // first call super stop() method then wait_thread().

Callers

nothing calls this directly

Calls 2

call_doneMethod · 0.95
joinMethod · 0.45

Tested by

no test coverage detected