|
| iMatix home page | << | < | > | >> |
SMTVersion 2.81 |
#include "smtlib.h" int smt_init (void)
Initialises the SMT. Returns 0 if there were no errors. Else returns -1, after seting smt_errno to one of these values:
| SMT OUTOFMEMORY | Not enough heap memory left |
{
int feedback = 0;
#if (defined (SMT_TRACE))
trace ("smt_init");
#endif
if (!smt_alive)
{
dict = sym_create_table ();
if (dict == NULL)
{
smt_errno = SMT_OUTOFMEMORY;
feedback = -1;
}
/* Initialise list of agents */
node_reset (&agents);
/* Initialise list of exit functions */
node_reset (&exitfcts);
/* Initialise list of semaphores */
node_reset (&semaphs);
/* Initialise list of active threads */
active_threads.left = &active_threads;
active_threads.right = &active_threads;
cur_threads = 0;
/* Handle interrupt signals */
handle_signals ();
/* On some systems we get a 'broken pipe' when a connection fails */
# if defined (SIGPIPE)
signal (SIGPIPE, SIG_IGN);
# endif
/* We pass through handle_atexit() before closing-down */
atexit (handle_atexit);
smt_alive = TRUE; /* SMT kernel is now active */
}
return (feedback);
}
| | << | < | > | >> |
|