Last active
August 29, 2015 13:57
-
-
Save jsbattig/9379100 to your computer and use it in GitHub Desktop.
SvcBusThreadPoolTimer constructor method (with bug)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int SvcBusThreadPoolTimer_init( SvcBusThreadPoolTimer* _this, SvcBusThreadPool* pool, SvcBusThreadPool_callback callback, void* context, unsigned int millis ) | |
{ | |
FILETIME FileDueTime; | |
ULARGE_INTEGER ulDueTime; | |
_this->timer = CreateThreadpoolTimer( &SvcBusThreadPoolTimer_TimerCallback, _this, &pool->pcbe ); | |
if( _this->timer == NULL ) | |
{ | |
return SVCBUS_THREADPOOL_ERROR; | |
} | |
_this->context = context; | |
_this->thread_id = 0; | |
_this->callback = callback; | |
ulDueTime.QuadPart = millis * 10 /* 100 nanosecond increments per microsecond */ * 1000 /* microseconds per millisecond */; | |
FileDueTime.dwHighDateTime = ulDueTime.HighPart; | |
FileDueTime.dwLowDateTime = ulDueTime.LowPart; | |
SetThreadpoolTimer( _this->timer, &FileDueTime, millis, 0 ); | |
return SVCBUS_THREADPOOL_OK; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment