• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Revisãoaa631f1f713fb458d49d75f67adedd3f82ce7595 (tree)
Hora2016-09-02 21:08:02
AutorJaap Jan Meijer <jjmeijer88@gmai...>
CommiterJaap Jan Meijer

Mensagem de Log

Merge remote-tracking branch 'cm/cm-13.0' into cm-13.0-x86

Mudança Sumário

Diff

--- a/libutils/SystemClock.cpp
+++ b/libutils/SystemClock.cpp
@@ -121,9 +121,11 @@ int64_t elapsedRealtimeNano()
121121 #endif
122122
123123 static int s_fd = -1;
124+ bool need_unlock = false;
124125
125126 if (clock_method < 0) {
126127 pthread_mutex_lock(&clock_lock);
128+ need_unlock = true;
127129 }
128130
129131 if (clock_method < 0 || clock_method == METHOD_IOCTL) {
@@ -143,6 +145,8 @@ int64_t elapsedRealtimeNano()
143145 checkTimeStamps(timestamp, &prevTimestamp, &prevMethod, METHOD_IOCTL);
144146 if (clock_method < 0) {
145147 clock_method = METHOD_IOCTL;
148+ }
149+ if (need_unlock) {
146150 pthread_mutex_unlock(&clock_lock);
147151 }
148152 return timestamp;
@@ -159,6 +163,8 @@ int64_t elapsedRealtimeNano()
159163 METHOD_CLOCK_GETTIME);
160164 if (clock_method < 0) {
161165 clock_method = METHOD_CLOCK_GETTIME;
166+ }
167+ if (need_unlock) {
162168 pthread_mutex_unlock(&clock_lock);
163169 }
164170 return timestamp;
@@ -173,6 +179,8 @@ int64_t elapsedRealtimeNano()
173179 METHOD_SYSTEMTIME);
174180 if (clock_method < 0) {
175181 clock_method = METHOD_SYSTEMTIME;
182+ }
183+ if (need_unlock) {
176184 pthread_mutex_unlock(&clock_lock);
177185 }
178186 return timestamp;