blob: 167a278a2b07a5879c11f9def948057a2667ec4c [file] [log] [blame] [edit]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/sys/fuzzing/common/dispatcher.h"
#include <lib/async-loop/default.h>
#include <lib/syslog/cpp/macros.h>
#include <zircon/status.h>
namespace fuzzing {
Dispatcher::Dispatcher() {
loop_ = std::make_unique<async::Loop>(&kAsyncLoopConfigNoAttachToCurrentThread);
auto status = loop_->StartThread("fuzzing-dispatcher", &thrd_);
FX_DCHECK(status == ZX_OK) << zx_status_get_string(status);
}
Dispatcher::~Dispatcher() { Shutdown(); }
void Dispatcher::Shutdown() { loop_->Shutdown(); }
} // namespace fuzzing