PageRenderTime 46ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/mordor/sleep.h

http://github.com/mozy/mordor
C Header | 25 lines | 8 code | 6 blank | 11 comment | 0 complexity | 6a4543aea7b6983f878172b6641dd987 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. #ifndef __MORDOR_SLEEP_H__
  2. #define __MORDOR_SLEEP_H__
  3. // Copyright (c) 2009 - Mozy, Inc.
  4. namespace Mordor {
  5. class TimerManager;
  6. /// Suspend execution of the current thread
  7. /// @note This is a normal sleep, and will block the current thread
  8. /// @param us How long to sleep, in microseconds
  9. void sleep(unsigned long long us);
  10. /// Suspend execution of the current Fiber
  11. /// @note This will use the TimerManager to yield the current Fiber and allow
  12. /// other Fibers to run until this Fiber is ready to run again.
  13. /// @param timerManager The TimerManager (typically an IOManager) to use to
  14. /// to control this sleep
  15. /// @param us How long to sleep, in microseconds
  16. /// @pre Scheduler::getThis() != NULL
  17. void sleep(TimerManager &timerManager, unsigned long long us);
  18. }
  19. #endif