Browse Source

Add functions ngSpice_LockRealloc and ngSpice_UnlockRealloc

to lock reallocing output vectors, e.g. during reading the
vecs for plotting.
pre-master-46
Holger Vogt 2 years ago
parent
commit
1849a8d220
  1. 16
      src/sharedspice.c

16
src/sharedspice.c

@ -775,6 +775,8 @@ read_initialisation_file(const char *dir, const char *name)
/* The functions exported explicitely from shared ngspice */ /* The functions exported explicitely from shared ngspice */
/**********************************************************/ /**********************************************************/
#ifdef THREADS #ifdef THREADS
/* Checks if ngspice is running in the background */ /* Checks if ngspice is running in the background */
@ -1337,6 +1339,20 @@ char** ngSpice_AllEvtNodes(void)
} }
#endif #endif
/* Lock/unlock realloc of result vectors during plotting */
IMPEXP
int ngSpice_LockRealloc(void)
{
mutex_lock(&vecreallocMutex);
return 1;
}
IMPEXP
int ngSpice_UnlockRealloc(void)
{
mutex_unlock(&vecreallocMutex);
return 1;
}
/* add the preliminary breakpoints to the list. /* add the preliminary breakpoints to the list.
called from dctran.c */ called from dctran.c */

Loading…
Cancel
Save