MIDAS
|
Classes | |
struct | FL_PARAM |
struct | suspend_struct |
Macros | |
#define | bin_to_ascii(c) ((c)>=38?((c)-38+'a'):(c)>=12?((c)-12+'A'):(c)+'.') |
#define | N_STACK_HISTORY 500 |
Typedefs | |
typedef struct suspend_struct | SUSPEND_STRUCT |
Variables | ||
struct { | ||
char c | ||
double d | ||
} | test_align | |
struct { | ||
double d | ||
char c | ||
} | test_padding | |
static BOOL | _daemon_flag | |
static std::atomic_bool | s_semaphore_trace {false} | |
static std::atomic_int | s_semaphore_nest_level {0} | |
static std::mutex | gTzMutex | |
void(* | MidasExceptionHandler )(void) | |
static std::vector< SUSPEND_STRUCT * > | _ss_suspend_vector | |
static midas_thread_t | _ss_odb_thread = 0 | |
static SUSPEND_STRUCT * | _ss_suspend_odb = NULL | |
static midas_thread_t | _ss_listen_thread = 0 | |
static int | _ss_server_listen_socket = 0 | |
static int | _ss_client_listen_socket = 0 | |
static midas_thread_t | _ss_client_thread = 0 | |
static RPC_SERVER_CONNECTION * | _ss_client_connection = NULL | |
static midas_thread_t | _ss_server_thread = 0 | |
static RPC_SERVER_ACCEPTION_LIST * | _ss_server_acceptions = NULL | |
static bool | gSocketTrace = false | |
char | stack_history [N_STACK_HISTORY][80] | |
int | stack_history_pointer = -1 | |
dox
Definition at line 7967 of file system.cxx.
#define N_STACK_HISTORY 500 |
Definition at line 8068 of file system.cxx.
Definition at line 170 of file system.cxx.
Definition at line 82 of file system.cxx.
Definition at line 5471 of file system.cxx.
Definition at line 5526 of file system.cxx.
Definition at line 5634 of file system.cxx.
Definition at line 16158 of file midas.cxx.
Definition at line 5357 of file system.cxx.
Definition at line 3809 of file system.cxx.
std::string EXPRT ss_asctime | ( | ) |
Definition at line 3621 of file system.cxx.
Definition at line 7377 of file system.cxx.
Definition at line 7969 of file system.cxx.
Definition at line 3971 of file system.cxx.
Definition at line 2073 of file system.cxx.
Definition at line 7264 of file system.cxx.
Definition at line 6874 of file system.cxx.
Definition at line 6892 of file system.cxx.
Definition at line 7889 of file system.cxx.
Definition at line 7925 of file system.cxx.
Definition at line 6950 of file system.cxx.
Definition at line 6968 of file system.cxx.
Definition at line 6698 of file system.cxx.
Definition at line 7126 of file system.cxx.
bool ss_event_socket_has_data | ( | ) |
Definition at line 4592 of file system.cxx.
Definition at line 3916 of file system.cxx.
Definition at line 2204 of file system.cxx.
Definition at line 2309 of file system.cxx.
Definition at line 2140 of file system.cxx.
Definition at line 7297 of file system.cxx.
Definition at line 7196 of file system.cxx.
Definition at line 6791 of file system.cxx.
Definition at line 6809 of file system.cxx.
Definition at line 7232 of file system.cxx.
Definition at line 7030 of file system.cxx.
Definition at line 7050 of file system.cxx.
Definition at line 7088 of file system.cxx.
std::string ss_get_cmdline | ( | void | ) |
Definition at line 1519 of file system.cxx.
std::string ss_get_executable | ( | void | ) |
Definition at line 1490 of file system.cxx.
Definition at line 1321 of file system.cxx.
Definition at line 1347 of file system.cxx.
Definition at line 7581 of file system.cxx.
std::string EXPRT ss_getcwd | ( | ) |
Definition at line 5848 of file system.cxx.
std::string ss_gethostname | ( | ) |
Definition at line 5784 of file system.cxx.
Definition at line 5818 of file system.cxx.
Definition at line 7518 of file system.cxx.
Definition at line 1379 of file system.cxx.
Definition at line 7848 of file system.cxx.
midas_thread_t EXPRT ss_gettid | ( | void | ) |
Definition at line 1591 of file system.cxx.
Definition at line 8146 of file system.cxx.
Definition at line 8044 of file system.cxx.
Definition at line 8039 of file system.cxx.
Definition at line 3736 of file system.cxx.
Definition at line 1473 of file system.cxx.
|
static |
Definition at line 4065 of file system.cxx.
Returns the actual time in milliseconds with an arbitrary origin. This time may only be used to calculate relative times.
Overruns in the 32 bit value don't hurt since in a subtraction calculated with 32 bit accuracy this overrun cancels (you may think about!)..
Definition at line 3465 of file system.cxx.
Definition at line 3437 of file system.cxx.
Definition at line 3013 of file system.cxx.
Definition at line 3283 of file system.cxx.
Definition at line 3229 of file system.cxx.
Definition at line 3109 of file system.cxx.
Definition at line 1442 of file system.cxx.
Definition at line 7460 of file system.cxx.
INT EXPRT ss_recv_net_command | ( | int | sock, |
DWORD * | routine_id, | ||
DWORD * | param_size, | ||
char ** | param_ptr, | ||
int | timeout_ms | ||
) |
Definition at line 5707 of file system.cxx.
Definition at line 8229 of file system.cxx.
bool ss_repair_utf8 | ( | std::string & | s | ) |
Definition at line 8325 of file system.cxx.
Definition at line 2284 of file system.cxx.
Definition at line 4916 of file system.cxx.
Definition at line 2532 of file system.cxx.
Definition at line 2941 of file system.cxx.
Definition at line 2853 of file system.cxx.
Definition at line 2711 of file system.cxx.
Definition at line 7427 of file system.cxx.
Definition at line 3547 of file system.cxx.
Definition at line 1832 of file system.cxx.
Definition at line 757 of file system.cxx.
Definition at line 911 of file system.cxx.
INT ss_shm_flush | ( | const char * | name, |
const void * | adr, | ||
size_t | size, | ||
HNDLE | handle, | ||
bool | wait_for_thread | ||
) |
Definition at line 1178 of file system.cxx.
Definition at line 1138 of file system.cxx.
|
static |
Definition at line 232 of file system.cxx.
INT ss_shm_open | ( | const char * | name, |
INT | size, | ||
void ** | adr, | ||
size_t * | shm_size, | ||
HNDLE * | handle, | ||
BOOL | get_size | ||
) |
Definition at line 326 of file system.cxx.
Definition at line 1005 of file system.cxx.
INT ss_shm_unprotect | ( | HNDLE | handle, |
void ** | adr, | ||
size_t | shm_size, | ||
BOOL | read, | ||
BOOL | write, | ||
const char * | caller_name | ||
) |
Definition at line 1062 of file system.cxx.
Suspend the calling process for a certain time.
The function is similar to the sleep() function, but has a resolution of one milliseconds. Under VxWorks the resolution is 1/60 of a second. It uses the socket select() function with a time-out. See examples in ss_time()
millisec | Time in milliseconds to sleep. Zero means infinite (until another process calls ss_wake) |
Definition at line 3700 of file system.cxx.
Definition at line 4565 of file system.cxx.
Definition at line 5303 of file system.cxx.
INT EXPRT ss_socket_connect_tcp | ( | const char * | hostname, |
int | tcp_port, | ||
int * | sockp, | ||
std::string * | error_msg_p | ||
) |
Definition at line 5039 of file system.cxx.
Definition at line 5318 of file system.cxx.
INT EXPRT ss_socket_listen_tcp | ( | bool | listen_localhost, |
int | tcp_port, | ||
int * | sockp, | ||
int * | tcp_port_p, | ||
std::string * | error_msg_p | ||
) |
Definition at line 5134 of file system.cxx.
Definition at line 4970 of file system.cxx.
Definition at line 1702 of file system.cxx.
Definition at line 8072 of file system.cxx.
Definition at line 8122 of file system.cxx.
Definition at line 8100 of file system.cxx.
Definition at line 4615 of file system.cxx.
|
static |
Definition at line 4279 of file system.cxx.
INT ss_suspend_exit | ( | ) |
Definition at line 4298 of file system.cxx.
INT ss_suspend_get_buffer_port | ( | midas_thread_t | thread_id, |
INT * | port | ||
) |
Definition at line 4425 of file system.cxx.
Definition at line 4399 of file system.cxx.
SUSPEND_STRUCT * ss_suspend_get_struct | ( | midas_thread_t | thread_id | ) |
Definition at line 4237 of file system.cxx.
INT ss_suspend_init_odb_port | ( | ) |
Definition at line 4377 of file system.cxx.
|
static |
Definition at line 4084 of file system.cxx.
Definition at line 4458 of file system.cxx.
INT ss_suspend_set_client_connection | ( | RPC_SERVER_CONNECTION * | connection | ) |
Definition at line 4363 of file system.cxx.
Definition at line 4356 of file system.cxx.
INT ss_suspend_set_rpc_thread | ( | midas_thread_t | thread_id | ) |
Definition at line 4074 of file system.cxx.
INT ss_suspend_set_server_acceptions | ( | RPC_SERVER_ACCEPTION_LIST * | acceptions | ) |
Definition at line 4370 of file system.cxx.
Definition at line 4349 of file system.cxx.
Execute command in a separate process, close all open file descriptors invoke ss_exec() and ignore pid.
command | Command to execute. |
Definition at line 2188 of file system.cxx.
Definition at line 5980 of file system.cxx.
Definition at line 6310 of file system.cxx.
Definition at line 6646 of file system.cxx.
Definition at line 6534 of file system.cxx.
Definition at line 5889 of file system.cxx.
Definition at line 6170 of file system.cxx.
Definition at line 6426 of file system.cxx.
Definition at line 6370 of file system.cxx.
Definition at line 6478 of file system.cxx.
Definition at line 6024 of file system.cxx.
Definition at line 6590 of file system.cxx.
Definition at line 6110 of file system.cxx.
Definition at line 6244 of file system.cxx.
midas_thread_t EXPRT ss_thread_create | ( | INT(*)(void *) | thread_func, |
void * | param | ||
) |
Creates and returns a new thread of execution.
Note the difference when calling from vxWorks versus Linux and Windows. The parameter pointer for a vxWorks call is a VX_TASK_SPAWN structure, whereas for Linux and Windows it is a void pointer. Early versions returned SS_SUCCESS or SS_NO_THREAD instead of thread ID.
Example for VxWorks
Example for Linux
(*thread_func) | Thread function to create. |
param | a pointer to a VX_TASK_SPAWN structure for vxWorks and a void pointer for Unix and Windows |
Definition at line 2382 of file system.cxx.
std::string ss_thread_get_name | ( | ) |
Definition at line 2516 of file system.cxx.
INT EXPRT ss_thread_kill | ( | midas_thread_t | thread_id | ) |
Destroys the thread identified by the passed thread id. The thread id is returned by ss_thread_create() on creation.
thread_id | the thread id of the thread to be killed. |
Definition at line 2455 of file system.cxx.
Definition at line 2498 of file system.cxx.
std::string ss_tid_to_string | ( | midas_thread_t | thread_id | ) |
Definition at line 1643 of file system.cxx.
Returns the actual time in seconds since 1.1.1970 UTC.
Definition at line 3534 of file system.cxx.
Definition at line 3539 of file system.cxx.
bool EXPRT ss_timed_mutex_wait_for_sec | ( | std::timed_mutex & | mutex, |
const char * | mutex_name, | ||
double | timeout_sec | ||
) |
Definition at line 3337 of file system.cxx.
Definition at line 3652 of file system.cxx.
Definition at line 3427 of file system.cxx.
unsigned int ss_us_since | ( | std::chrono::time_point< std::chrono::high_resolution_clock > | start | ) |
std::chrono::time_point< std::chrono::high_resolution_clock > ss_us_start | ( | ) |
Definition at line 8333 of file system.cxx.
Definition at line 5424 of file system.cxx.
|
static |
Definition at line 2071 of file system.cxx.
|
static |
Definition at line 4059 of file system.cxx.
|
static |
Definition at line 4056 of file system.cxx.
|
static |
Definition at line 4058 of file system.cxx.
|
static |
Definition at line 4054 of file system.cxx.
|
static |
Definition at line 4051 of file system.cxx.
|
static |
Definition at line 4062 of file system.cxx.
|
static |
Definition at line 4055 of file system.cxx.
|
static |
Definition at line 4061 of file system.cxx.
|
static |
Definition at line 4052 of file system.cxx.
|
static |
Definition at line 4049 of file system.cxx.
char { ... } ::c |
Definition at line 1312 of file system.cxx.
char { ... } ::c |
Definition at line 1318 of file system.cxx.
double { ... } ::d |
Definition at line 1313 of file system.cxx.
double { ... } ::d |
Definition at line 1317 of file system.cxx.
Definition at line 5036 of file system.cxx.
|
static |
Definition at line 3425 of file system.cxx.
Definition at line 3861 of file system.cxx.
|
static |
Definition at line 2530 of file system.cxx.
|
static |
Definition at line 2529 of file system.cxx.
char stack_history[N_STACK_HISTORY][80] |
Definition at line 8069 of file system.cxx.
int stack_history_pointer = -1 |
Definition at line 8070 of file system.cxx.
struct { ... } test_align |
struct { ... } test_padding |