mirror of
https://github.com/isar/libmdbx.git
synced 2025-10-16 20:02:46 +08:00
mdbx: extract internal osal_yield()
.
This commit is contained in:
@@ -593,11 +593,6 @@ int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout) {
|
||||
return sigbreak ? EINTR : 0 /* timeout */;
|
||||
}
|
||||
|
||||
void osal_yield(void) {
|
||||
if (sched_yield())
|
||||
failure_perror("sched_yield()", errno);
|
||||
}
|
||||
|
||||
void osal_udelay(size_t us) {
|
||||
chrono::time until, now = chrono::now_monotonic();
|
||||
until.fixedpoint = now.fixedpoint + chrono::from_us(us).fixedpoint;
|
||||
|
@@ -401,8 +401,6 @@ int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout) {
|
||||
}
|
||||
}
|
||||
|
||||
void osal_yield(void) { SwitchToThread(); }
|
||||
|
||||
void osal_udelay(size_t us) {
|
||||
chrono::time until, now = chrono::now_monotonic();
|
||||
until.fixedpoint = now.fixedpoint + chrono::from_us(us).fixedpoint;
|
||||
|
@@ -20,7 +20,6 @@ bool osal_multiactor_mode(void);
|
||||
|
||||
int osal_delay(unsigned seconds);
|
||||
void osal_udelay(size_t us);
|
||||
void osal_yield(void);
|
||||
bool osal_istty(int fd);
|
||||
std::string osal_tempdir(void);
|
||||
|
||||
|
Reference in New Issue
Block a user