mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
38aba43111
The isolate's mutator_thread_ field actually represents the mutator thread scheduled by the isolate. This was confused with the mutator thread created by the thread_registry, which is a singleton. R=asiva@google.com, rmacnak@google.com Review-Url: https://codereview.chromium.org/2999583002 .
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef RUNTIME_VM_BASE_ISOLATE_H_
|
|
#define RUNTIME_VM_BASE_ISOLATE_H_
|
|
|
|
#include "platform/assert.h"
|
|
#include "vm/globals.h"
|
|
|
|
namespace dart {
|
|
|
|
class HandleScope;
|
|
class StackResource;
|
|
class Thread;
|
|
class Zone;
|
|
|
|
// A BaseIsolate contains just enough functionality to allocate
|
|
// StackResources. This allows us to inline the StackResource
|
|
// constructor/destructor for performance.
|
|
class BaseIsolate {
|
|
public:
|
|
#if defined(DEBUG)
|
|
void AssertCurrentThreadIsMutator() const;
|
|
#else
|
|
void AssertCurrentThreadIsMutator() const {}
|
|
#endif // DEBUG
|
|
|
|
#if defined(DEBUG)
|
|
static void AssertCurrent(BaseIsolate* isolate);
|
|
#endif
|
|
|
|
protected:
|
|
BaseIsolate() : scheduled_mutator_thread_(NULL) {}
|
|
|
|
~BaseIsolate() {
|
|
// Do not delete stack resources: top_resource_ and current_zone_.
|
|
}
|
|
|
|
Thread* scheduled_mutator_thread_;
|
|
|
|
private:
|
|
DISALLOW_COPY_AND_ASSIGN(BaseIsolate);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_BASE_ISOLATE_H_
|