1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
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 file,
5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #include "FileHandleCommon.h"
8 
9 #include "mozilla/Assertions.h"
10 #include "prthread.h"
11 
12 namespace mozilla {
13 namespace dom {
14 
15 #ifdef DEBUG
16 
17 void
AssertIsOnOwningThread() const18 ThreadObject::AssertIsOnOwningThread() const
19 {
20   MOZ_ASSERT(mOwningThread);
21   MOZ_ASSERT(PR_GetCurrentThread() == mOwningThread);
22 }
23 
24 PRThread*
OwningThread() const25 ThreadObject::OwningThread() const
26 {
27   MOZ_ASSERT(mOwningThread);
28   return mOwningThread;
29 }
30 
31 #endif // DEBUG
32 
33 } // namespace dom
34 } // namespace mozilla
35