Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: talk/app/webrtc/java/android/org/webrtc/ThreadUtils.java

Issue 1401023003: Make VideoCapturerAndroid work on SDK level 16 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 result.value = callable.call(); 119 result.value = callable.call();
120 } catch (Exception e) { 120 } catch (Exception e) {
121 throw new RuntimeException("Callable threw exception: " + e); 121 throw new RuntimeException("Callable threw exception: " + e);
122 } 122 }
123 barrier.countDown(); 123 barrier.countDown();
124 } 124 }
125 }); 125 });
126 awaitUninterruptibly(barrier); 126 awaitUninterruptibly(barrier);
127 return result.value; 127 return result.value;
128 } 128 }
129
130 /**
131 * Post |runner| to |handler| and wait for the result.
132 */
133 public static void invokeUninterruptibly(final Handler handler, final Runnable runner) {
134 final CountDownLatch barrier = new CountDownLatch(1);
135 handler.post(new Runnable() {
136 @Override public void run() {
137 runner.run();
138 barrier.countDown();
139 }
140 });
141 awaitUninterruptibly(barrier);
142 }
129 } 143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698