mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 01:53:02 +01:00
fix rare bug preventing toxcore from sleeping
This commit is contained in:
parent
ecefc19b23
commit
0047ba0e9f
@ -1048,7 +1048,7 @@ static int init_default_data_files(void)
|
|||||||
/* Adjusts usleep value so that tox_do runs close to the recommended number of times per second */
|
/* Adjusts usleep value so that tox_do runs close to the recommended number of times per second */
|
||||||
static useconds_t optimal_msleepval(uint64_t *looptimer, uint64_t *loopcount, uint64_t cur_time, useconds_t msleepval)
|
static useconds_t optimal_msleepval(uint64_t *looptimer, uint64_t *loopcount, uint64_t cur_time, useconds_t msleepval)
|
||||||
{
|
{
|
||||||
useconds_t new_sleep = msleepval;
|
useconds_t new_sleep = MAX(msleepval, 3);
|
||||||
++(*loopcount);
|
++(*loopcount);
|
||||||
|
|
||||||
if (*looptimer == cur_time)
|
if (*looptimer == cur_time)
|
||||||
|
Loading…
Reference in New Issue
Block a user