MCPcopy Create free account
hub / github.com/TigerVNC/tigervnc / run

Method run

java/com/tigervnc/rfb/DecodeManager.java:266–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

264 }
265
266 public void run()
267 {
268 manager.queueMutex.lock();
269
270 while (!stopRequested) {
271 QueueEntry entry;
272
273 // Look for an available entry in the work queue
274 entry = findEntry();
275 if (entry == null) {
276 // Wait and try again
277 try {
278 manager.consumerCond.await();
279 } catch (InterruptedException e) { }
280 continue;
281 }
282
283 // This is ours now
284 entry.active = true;
285
286 manager.queueMutex.unlock();
287
288 // Do the actual decoding
289 try {
290 entry.decoder.decodeRect(entry.rect, entry.bufferStream.data(),
291 entry.bufferStream.length(),
292 entry.server, entry.pb);
293 } catch (com.tigervnc.rdr.Exception e) {
294 manager.setThreadException(e);
295 } catch(java.lang.Exception e) {
296 assert(false);
297 }
298
299 manager.queueMutex.lock();
300
301 // Remove the entry from the queue and give back the memory buffer
302 manager.freeBuffers.addLast(entry.bufferStream);
303 manager.workQueue.remove(entry);
304 entry = null;
305
306 // Wake the main thread in case it is waiting for a memory buffer
307 manager.producerCond.signal();
308 // This rect might have been blocking multiple other rects, so
309 // wake up every worker thread
310 if (manager.workQueue.size() > 1)
311 manager.consumerCond.signalAll();
312 }
313
314 manager.queueMutex.unlock();
315 }
316
317 protected QueueEntry findEntry()
318 {

Callers

nothing calls this directly

Calls 8

findEntryMethod · 0.95
awaitMethod · 0.80
removeMethod · 0.65
decodeRectMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45
setThreadExceptionMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected