FileHandleCommon.cpp 723 B

12345678910111213141516171819202122232425262728293031323334
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  4. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "FileHandleCommon.h"
  6. #include "mozilla/Assertions.h"
  7. #include "prthread.h"
  8. namespace mozilla {
  9. namespace dom {
  10. #ifdef DEBUG
  11. void
  12. ThreadObject::AssertIsOnOwningThread() const
  13. {
  14. MOZ_ASSERT(mOwningThread);
  15. MOZ_ASSERT(PR_GetCurrentThread() == mOwningThread);
  16. }
  17. PRThread*
  18. ThreadObject::OwningThread() const
  19. {
  20. MOZ_ASSERT(mOwningThread);
  21. return mOwningThread;
  22. }
  23. #endif // DEBUG
  24. } // namespace dom
  25. } // namespace mozilla