コード例 #1
0
ファイル: getch.cpp プロジェクト: DinrusGroup/DinrusUcrtBased
extern "C" int __cdecl _getche()
{
    __acrt_lock(__acrt_conio_lock);
    int result = 0;
    __try
    {
        result = _getche_nolock();
    }
    __finally
    {
        __acrt_unlock(__acrt_conio_lock);
    }
    return result;
}
コード例 #2
0
ファイル: getch.c プロジェクト: flychen50/clib
int __cdecl _getche (
        void
        )
{
        int ch;

        _mlock(_CONIO_LOCK);            /* secure the console lock */
        __TRY
            ch = _getche_nolock();              /* input and echo the character */
        __FINALLY
            _munlock(_CONIO_LOCK);          /* unlock the console */
        __END_TRY_FINALLY

        return ch;
}