We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这个软定时器个人觉得很不错啊,但是带参函数的定时似乎没法做到,有办法解决吗
The text was updated successfully, but these errors were encountered:
目前我的解决办法是定义全局变量标志位,然后定时器做置位操作;然后在while循环里轮询标志位,通过标志位判断来定时调用带参函数。
Sorry, something went wrong.
可以将回调函数形参修改为(void *arg),在初始化timer是将所需传递数据放入,回调触发时进行数据转换,以此实现参数传递。这个实现参考自线程pthread_create函数中对于不定类型参数的传递处理。
No branches or pull requests
这个软定时器个人觉得很不错啊,但是带参函数的定时似乎没法做到,有办法解决吗
The text was updated successfully, but these errors were encountered: