1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2/* vim:set ts=2 sw=2 sts=2 et cindent: */ 3/* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7#include "nsIEventTarget.idl" 8 9/** 10 * A serial event target is an event dispatching interface like 11 * nsIEventTarget. Runnables dispatched to an nsISerialEventTarget are required 12 * to execute serially. That is, two different runnables dispatched to the 13 * target should never be allowed to execute simultaneously. One exception to 14 * this rule is nested event loops. If a runnable spins a nested event loop, 15 * causing another runnable dispatched to the target to run, the target may 16 * still be considered "serial". 17 * 18 * Examples: 19 * - nsIThread is a serial event target. 20 * - Thread pools are not serial event targets. 21 * - However, one can "convert" a thread pool into an nsISerialEventTarget 22 * by putting a TaskQueue in front of it. 23 */ 24[builtinclass, scriptable, uuid(9f982380-24b4-49f3-88f6-45e2952036c7)] 25interface nsISerialEventTarget : nsIEventTarget 26{ 27}; 28