2019-09-09 13:40:24 +03:00
|
|
|
/*
|
2024-03-13 14:57:38 +03:00
|
|
|
* Copyright 2017-2024 Leonid Yuriev <leo@yuriev.ru>
|
2017-03-30 18:54:57 +03:00
|
|
|
* and other libmdbx authors: please see AUTHORS file.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-11-08 16:17:14 +03:00
|
|
|
#include "base.h++"
|
2017-03-30 18:54:57 +03: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 18:33:35 +03:00
|
|
|
|
2019-10-02 01:17:09 +03:00
|
|
|
bool osal_progress_push(bool active);
|
|
|
|
|
2017-04-21 18:33:35 +03:00
|
|
|
mdbx_pid_t osal_getpid(void);
|
|
|
|
int osal_delay(unsigned seconds);
|
2022-05-15 23:42:57 +03:00
|
|
|
void osal_udelay(size_t us);
|
2017-04-21 18:33:35 +03:00
|
|
|
void osal_yield(void);
|
2017-05-24 02:16:25 +03:00
|
|
|
bool osal_istty(int fd);
|
2018-03-19 20:40:10 +03:00
|
|
|
std::string osal_tempdir(void);
|
2017-05-24 02:43:43 +03: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-08 19:58:18 +03:00
|
|
|
|
|
|
|
#if !defined(_WIN32) && !defined(_WIN64)
|
|
|
|
const char *signal_name(const int sig);
|
|
|
|
#endif /* Windows */
|