PageRenderTime 29ms CodeModel.GetById 26ms app.highlight 1ms RepoModel.GetById 1ms 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
 1#ifndef __MORDOR_SLEEP_H__
 2#define __MORDOR_SLEEP_H__
 3// Copyright (c) 2009 - Mozy, Inc.
 4
 5namespace Mordor {
 6
 7class TimerManager;
 8
 9/// Suspend execution of the current thread
10/// @note This is a normal sleep, and will block the current thread
11/// @param us How long to sleep, in microseconds
12void sleep(unsigned long long us);
13
14/// Suspend execution of the current Fiber
15/// @note This will use the TimerManager to yield the current Fiber and allow
16/// other Fibers to run until this Fiber is ready to run again.
17/// @param timerManager The TimerManager (typically an IOManager) to use to
18/// to control this sleep
19/// @param us How long to sleep, in microseconds
20/// @pre Scheduler::getThis() != NULL
21void sleep(TimerManager &timerManager, unsigned long long us);
22
23}
24
25#endif