Blame toonz/sources/stdfx/igs_resource_sleep_unix.h
|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Shinya Kitaoka |
810553 |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef igs_resource_sleep_h
|
|
Toshihiro Shimizu |
890ddd |
#define igs_resource_sleep_h
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
#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 |
|
|
Shinya Kitaoka |
120a6e |
namespace igs {
|
|
Shinya Kitaoka |
120a6e |
namespace resource {
|
|
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
|
|
Shinya Kitaoka |
120a6e |
#include <ctime> // time_t, ::nanosleep()</ctime>
|
|
Shinya Kitaoka |
120a6e |
namespace igs {
|
|
Shinya Kitaoka |
120a6e |
namespace resource {
|
|
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範囲外、はエラー
|
|
Shinya Kitaoka |
120a6e |
*/
|
|
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 */
|