v8js_timer.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2013 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | http://www.opensource.org/licenses/mit-license.php MIT License |
  8. +----------------------------------------------------------------------+
  9. | Author: Jani Taskinen <[email protected]> |
  10. | Author: Patrick Reilly <[email protected]> |
  11. +----------------------------------------------------------------------+
  12. */
  13. #ifndef V8JS_TIMER_H
  14. #define V8JS_TIMER_H
  15. // Timer context
  16. struct v8js_timer_ctx
  17. {
  18. long time_limit;
  19. size_t memory_limit;
  20. std::chrono::time_point<std::chrono::high_resolution_clock> time_point;
  21. v8js_ctx *ctx;
  22. bool killed;
  23. };
  24. void v8js_timer_thread(zend_v8js_globals *globals);
  25. void v8js_timer_push(long time_limit, size_t memory_limit, v8js_ctx *c);
  26. #endif /* V8JS_TIMER_H */
  27. /*
  28. * Local variables:
  29. * tab-width: 4
  30. * c-basic-offset: 4
  31. * indent-tabs-mode: t
  32. * End:
  33. * vim600: noet sw=4 ts=4 fdm=marker
  34. * vim<600: noet sw=4 ts=4
  35. */