2024-05-20 03:07:58 +08:00
|
|
|
/// \author Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru> \date 2015-2024
|
|
|
|
/// \copyright SPDX-License-Identifier: Apache-2.0
|
2017-03-30 23:54:57 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-11-08 21:17:14 +08:00
|
|
|
#include "base.h++"
|
2017-03-30 23:54:57 +08:00
|
|
|
|
|
|
|
void osal_setup(const std::vector<actor_config> &actors);
|
|
|
|
void osal_broadcast(unsigned id);
|
|
|
|
int osal_waitfor(unsigned id);
|
|
|
|
|
|
|
|
int osal_actor_start(const actor_config &config, mdbx_pid_t &pid);
|
|
|
|
actor_status osal_actor_info(const mdbx_pid_t pid);
|
|
|
|
void osal_killall_actors(void);
|
|
|
|
int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout);
|
|
|
|
void osal_wait4barrier(void);
|
2017-04-21 23:33:35 +08:00
|
|
|
|
2019-10-02 06:17:09 +08:00
|
|
|
bool osal_progress_push(bool active);
|
2024-07-11 03:31:41 +08:00
|
|
|
bool osal_multiactor_mode(void);
|
2019-10-02 06:17:09 +08:00
|
|
|
|
2017-04-21 23:33:35 +08:00
|
|
|
int osal_delay(unsigned seconds);
|
2022-05-16 04:42:57 +08:00
|
|
|
void osal_udelay(size_t us);
|
2017-04-21 23:33:35 +08:00
|
|
|
void osal_yield(void);
|
2017-05-24 07:16:25 +08:00
|
|
|
bool osal_istty(int fd);
|
2018-03-20 01:40:10 +08:00
|
|
|
std::string osal_tempdir(void);
|
2017-05-24 07:43:43 +08:00
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#ifndef STDIN_FILENO
|
|
|
|
#define STDIN_FILENO _fileno(stdin)
|
|
|
|
#endif
|
|
|
|
#ifndef STDOUT_FILENO
|
|
|
|
#define STDOUT_FILENO _fileno(stdout)
|
|
|
|
#endif
|
|
|
|
#ifndef STDERR_FILENO
|
|
|
|
#define STDERR_FILENO _fileno(stderr)
|
|
|
|
#endif
|
|
|
|
#endif /* _MSC_VER */
|
2023-11-09 00:58:18 +08:00
|
|
|
|
|
|
|
#if !defined(_WIN32) && !defined(_WIN64)
|
|
|
|
const char *signal_name(const int sig);
|
|
|
|
#endif /* Windows */
|