Functions | |
INT | ss_system (char *command) |
midas_thread_t | ss_thread_create (INT(*thread_func)(void *), void *param) |
INT | ss_thread_kill (midas_thread_t thread_id) |
DWORD | ss_millitime () |
DWORD | ss_time () |
INT | ss_sleep (INT millisec) |
|
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!).. ... DWORD start, stop: start = ss_millitime(); < do operations > stop = ss_millitime(); printf("Operation took %1.3lf seconds\n",(stop-start)/1000.0); ...
Definition at line 1989 of file system.c. Referenced by bm_check_buffers(), bm_open_buffer(), close_buffers(), cm_cleanup(), cm_get_watchdog_info(), cm_set_watchdog_params(), cm_shutdown(), db_open_database(), dm_buffer_create(), register_equipment(), scan_fragment(), scheduler(), send_event(), and tr_stop(). |
|
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()
Definition at line 2221 of file system.c. Referenced by cm_shutdown(), main(), and register_equipment(). |
|
Execute command in a separate process, close all open file descriptors invoke ss_exec() and ignore pid. { ... char cmd[256]; sprintf(cmd,"%s %s %i %s/%s %1.3lf %d",lazy.commandAfter, lazy.backlabel, lazyst.nfiles, lazy.path, lazyst.backfile, lazyst.file_size/1024.0/1024.0, blockn); cm_msg(MINFO,"Lazy","Exec post file write script:%s",cmd); ss_system(cmd); } ...
Definition at line 1303 of file system.c. Referenced by cm_transition(). |
|
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 ... VX_TASK_SPAWN tsWatch = {"Watchdog", 100, 0, 2000, (int) pDevice, 0, 0, 0, 0, 0, 0, 0, 0 ,0}; midas_thread_t thread_id = ss_thread_create((void *) taskWatch, &tsWatch); if (thread_id == 0) { printf("cannot spawn taskWatch\n"); } ... ... midas_thread_t thread_id = ss_thread_create((void *) taskWatch, pDevice); if (thread_id == 0) { printf("cannot spawn taskWatch\n"); } ...
Definition at line 1429 of file system.c. Referenced by dm_buffer_create(). |
|
Destroys the thread identified by the passed thread id. The thread id is returned by ss_thread_create() on creation.
... midas_thread_t thread_id = ss_thread_create((void *) taskWatch, pDevice); if (thread_id == 0) { printf("cannot spawn taskWatch\n"); } ... ss_thread_kill(thread_id); ...
|
|
Returns the actual time in seconds since 1.1.1970 UTC. ... DWORD start, stop: start = ss_time(); ss_sleep(12000); stop = ss_time(); printf("Operation took %1.3lf seconds\n",stop-start); ...
Definition at line 2056 of file system.c. Referenced by al_trigger_alarm(), bm_compose_event(), cm_synchronize(), cm_time(), cm_yield(), db_get_key_time(), db_set_data(), db_set_data_index(), db_set_value(), scheduler(), and send_event(). |