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

Side by Side Diff: Source/platform/heap/ThreadState.cpp

Issue 843263003: Tidy up ThreadState::removeInterruptor() assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 } 1099 }
1100 } 1100 }
1101 1101
1102 void ThreadState::removeInterruptor(Interruptor* interruptor) 1102 void ThreadState::removeInterruptor(Interruptor* interruptor)
1103 { 1103 {
1104 checkThread(); 1104 checkThread();
1105 SafePointScope scope(HeapPointersOnStack, SafePointScope::AllowNesting); 1105 SafePointScope scope(HeapPointersOnStack, SafePointScope::AllowNesting);
1106 { 1106 {
1107 MutexLocker locker(threadAttachMutex()); 1107 MutexLocker locker(threadAttachMutex());
1108 size_t index = m_interruptors.find(interruptor); 1108 size_t index = m_interruptors.find(interruptor);
1109 RELEASE_ASSERT(index >= 0); 1109 RELEASE_ASSERT(index != kNotFound);
1110 m_interruptors.remove(index); 1110 m_interruptors.remove(index);
1111 } 1111 }
1112 } 1112 }
1113 1113
1114 void ThreadState::Interruptor::onInterrupted() 1114 void ThreadState::Interruptor::onInterrupted()
1115 { 1115 {
1116 ThreadState* state = ThreadState::current(); 1116 ThreadState* state = ThreadState::current();
1117 ASSERT(state); 1117 ASSERT(state);
1118 ASSERT(!state->isAtSafePoint()); 1118 ASSERT(!state->isAtSafePoint());
1119 state->safePoint(HeapPointersOnStack); 1119 state->safePoint(HeapPointersOnStack);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 return gcInfo; 1161 return gcInfo;
1162 } 1162 }
1163 } 1163 }
1164 if (needLockForIteration) 1164 if (needLockForIteration)
1165 threadAttachMutex().unlock(); 1165 threadAttachMutex().unlock();
1166 return nullptr; 1166 return nullptr;
1167 } 1167 }
1168 #endif 1168 #endif
1169 1169
1170 } // namespace blink 1170 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698