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

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

Issue 311263008: Make |Heap::findGCInfo()| threadsafe. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: change check to isAnyThreadInGC Created 6 years, 6 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 | Annotate | Revision Log
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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 const GCInfo* findGCInfo(Address); 497 const GCInfo* findGCInfo(Address);
498 #endif 498 #endif
499 499
500 void pushWeakObjectPointerCallback(void*, WeakPointerCallback); 500 void pushWeakObjectPointerCallback(void*, WeakPointerCallback);
501 bool popAndInvokeWeakPointerCallback(Visitor*); 501 bool popAndInvokeWeakPointerCallback(Visitor*);
502 502
503 void getStats(HeapStats&); 503 void getStats(HeapStats&);
504 HeapStats& stats() { return m_stats; } 504 HeapStats& stats() { return m_stats; }
505 HeapStats& statsAfterLastGC() { return m_statsAfterLastGC; } 505 HeapStats& statsAfterLastGC() { return m_statsAfterLastGC; }
506 506
507 static Mutex& threadAttachMutex();
Mads Ager (chromium) 2014/06/06 06:54:01 Instead of exposing this, can you move the code th
kouhei (in TOK) 2014/06/06 06:58:26 Ack.
508
507 private: 509 private:
508 explicit ThreadState(); 510 explicit ThreadState();
509 ~ThreadState(); 511 ~ThreadState();
510 512
511 friend class SafePointBarrier; 513 friend class SafePointBarrier;
512 514
513 void enterSafePoint(StackState, void*); 515 void enterSafePoint(StackState, void*);
514 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope(); 516 NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope();
515 void clearSafePointScopeMarker() 517 void clearSafePointScopeMarker()
516 { 518 {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 }; 598 };
597 599
598 template<> class ThreadStateFor<AnyThread> { 600 template<> class ThreadStateFor<AnyThread> {
599 public: 601 public:
600 static ThreadState* state() { return ThreadState::current(); } 602 static ThreadState* state() { return ThreadState::current(); }
601 }; 603 };
602 604
603 } 605 }
604 606
605 #endif // ThreadState_h 607 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698