windows: Add a sleep function acting as cancellation point
This commit is contained in:
1 parent
266ee0a190
commit
986a577097
1 file changed
+9
@@ -76,6 +76,15 @@ static inline int sched_yield(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replacement of sleep(3), cancellable by thread_cancel()
|
||||||
|
*/
|
||||||
|
static inline int sleep(unsigned int seconds)
|
||||||
|
{
|
||||||
|
SleepEx(seconds * 1000, TRUE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* strdup(3), the Windows variant can't free(strdup("")) and others
|
* strdup(3), the Windows variant can't free(strdup("")) and others
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in new issue
Block a user