Ejemplo n.º 1
0
/*
** This function is threaded and watch for a signal.
** sent when StoreCommand is performed.
*/
static void initAll(void)
{
    /* Set console mode to raw */
#ifndef _MSC_VER
    if (getScilabMode() == SCILAB_NWNI || getScilabMode() == SCILAB_NW)
    {
        initConsoleMode(RAW);
    }
#endif
    initialized = TRUE;
    pReadyForLaunch = mmap(0, sizeof(__threadSignalLock), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
    atexit(release);
    __InitSignal(&TimeToWork);
    __InitSignalLock(pReadyForLaunch);
}
Ejemplo n.º 2
0
/*--------------------------------------------------------------------------*/
int OpenTCLsci(void)
{
    __InitSignalLock(&InterpReadyLock);
    __InitSignal(&InterpReady);
    // Open TCL interpreter in a separated thread.
    // Allows all Tcl application not to freeze nor decrease Scilab speed.
    // Causes also Scilab let those application live their own lifes.


    __CreateThread(&TclThread, &DaemonOpenTCLsci);
    // Wait to be sure initialisation is complete.
    __LockSignal(&InterpReadyLock);
    __Wait(&InterpReady, &InterpReadyLock);
    __UnLockSignal(&InterpReadyLock);

    return 0;
}