Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. // Copyright 2014 the V8 project authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_
  5. #define V8_LIBPLATFORM_LIBPLATFORM_H_
  6. #include "include/v8-platform.h"
  7. namespace v8 {
  8. namespace platform {
  9. /**
  10. * Returns a new instance of the default v8::Platform implementation.
  11. *
  12. * The caller will take ownership of the returned pointer. |thread_pool_size|
  13. * is the number of worker threads to allocate for background jobs. If a value
  14. * of zero is passed, a suitable default based on the current number of
  15. * processors online will be chosen.
  16. */
  17. v8::Platform* CreateDefaultPlatform(int thread_pool_size = 0);
  18. /**
  19. * Pumps the message loop for the given isolate.
  20. *
  21. * The caller has to make sure that this is called from the right thread.
  22. * Returns true if a task was executed, and false otherwise. This call does
  23. * not block if no task is pending. The |platform| has to be created using
  24. * |CreateDefaultPlatform|.
  25. */
  26. bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate);
  27. } // namespace platform
  28. } // namespace v8
  29. #endif // V8_LIBPLATFORM_LIBPLATFORM_H_