Blame toonz/sources/stdfx/igs_resource_sleep_unix.h
|
Toshihiro Shimizu |
890ddd |
#ifndef igs_resource_sleep_h
|
|
Toshihiro Shimizu |
890ddd |
#define igs_resource_sleep_h
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "igs_os_type.h" // DWORD
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef IGS_RESOURCE_IFX_EXPORT
|
|
Toshihiro Shimizu |
890ddd |
#define IGS_RESOURCE_IFX_EXPORT
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
namespace igs
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
namespace resource
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
/* 1second = 1,000milli_seconds(ミリ秒) */
|
|
Toshihiro Shimizu |
890ddd |
IGS_RESOURCE_IFX_EXPORT void sleep_m(const DWORD milli_seconds);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#if !defined _WIN32
|
|
Toshihiro Shimizu |
890ddd |
#include <ctime> // time_t, ::nanosleep()</ctime>
|
|
Toshihiro Shimizu |
890ddd |
namespace igs
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
namespace resource
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
/* unixではこちらがメイン,sleep_m()は内部でsleep_sn()を呼んでいる
|
|
Toshihiro Shimizu |
890ddd |
1second=1,000milli_seconds=1,000,000micro_seconds=1,000,000,000nano_seconds
|
|
Toshihiro Shimizu |
890ddd |
tv_sec(seconds)が負か、tv_nsec(nano_seconds)が0〜999,999,999範囲外、はエラー
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
void sleep_sn(const time_t seconds, const long nano_seconds);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
#endif /* !_WIN32 */
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif /* !igs_resource_sleep_h */
|