1 // Copyright 2018 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.base.task; 6 7 /** 8 * Tasks posted will be run in order on a single thread. Multiple SingleThreadTaskRunners 9 * can share a single thread. When sharing a thread, mutual exclusion is guaranteed but 10 * unless specified otherwise by the provider of a given SingleThreadTaskRunner there are 11 * no ordering guarantees w.r.t. other SingleThreadTaskRunner. 12 */ 13 public interface SingleThreadTaskRunner extends SequencedTaskRunner { 14 /** 15 * 16 * @return true iff this SingleThreadTaskRunner is bound to the current thread. 17 */ belongsToCurrentThread()18 boolean belongsToCurrentThread(); 19 } 20