Commit Graph

77 Commits

Author SHA1 Message Date
Holger Vogt 67ffc810a8 If there are no controls, just skip creating the controls thread. 2019-10-02 22:02:57 +02:00
Holger Vogt 5f4eb3ac61 prevent potential false reads if 'controlswait' is set. 2019-10-02 12:04:19 +02:00
Holger Vogt 518913dd0b no actions if controls thread tid2 is not set 2019-09-25 22:29:37 +02:00
Holger Vogt ef33e183f5 Better thread handling
Embed thread tid2 into tid1
Avoid spurious thread collisions
2019-09-25 10:13:37 +02:00
Holger Vogt 1c282bbeb7 Revert "encapsulate fcn calls to cp_evloop into a mutex"
This reverts commit 2426a037db.
2019-09-25 09:12:02 +02:00
Holger Vogt acd0c7156c return immediately if empty commands are sent 2019-09-20 19:22:47 +02:00
Holger Vogt 2426a037db encapsulate fcn calls to cp_evloop into a mutex
thus preventing thread collisions
2019-09-20 19:21:56 +02:00
Holger Vogt 0b92a15ae8 safeguard against vectors with 0 length 2019-08-13 23:33:28 +02:00
Holger Vogt c35879d3cf prepare ngspice-30 2018-12-23 13:55:45 +01:00
Holger Vogt 2c7860361d Prevent segfault if SendStat is NULL and HAVE_FTIME is undefined.
Patch no. 28 offered by Liang Chang
2018-12-17 23:07:41 +01:00
Holger Vogt 3f816d7f1b add comment 2018-12-17 23:07:19 +01:00
Holger Vogt a98f6ac69b proper initialization of OldAn, callback only
if output has changed
2018-12-17 23:07:00 +01:00
Holger Vogt 0f552fc4f8 sharedspice.c, prevent crash, if controlswait is set
and a next bg_run before controls are ready.
2018-12-17 23:06:49 +01:00
Holger Vogt 98a5106015 simplify and re-enble MINGW 2018-12-17 23:05:55 +01:00
Holger Vogt 2a2a7c2d36 sharedspice.c, NS Windows, use only POSIX compliant snprintf
make OldAn a zero terminated string
2018-12-17 23:05:41 +01:00
Holger Vogt 0828a8e706 new command bg_ctrl initializing the .control executing thread
pthreads: using detached threads only
keep controls during 'reset', delete only upon 'quit'
2018-12-17 23:05:25 +01:00
Holger Vogt f6b995b80e remove unused fcn declaration 2018-12-17 23:05:05 +01:00
Holger Vogt 6f79db19d1 pthreads: suspend thread 3 (controls) with a condition variable 2018-12-17 23:04:57 +01:00
Holger Vogt e4aabc82c7 shared ngspice: add a third thread to execute the .control commands
only after the background thread has been finished
2018-12-17 23:04:31 +01:00
dwarning 079b3bb7fd add some missing prototypes 2018-10-27 11:08:17 +02:00
dwarning 67b38d7885 remove empty statement 2018-10-15 16:06:57 +02:00
Holger Vogt 92b69cbc55 prepare ngspice-29 2018-09-26 18:45:35 +02:00
Holger Vogt 7ca61b3c98 New command 'setseed' with function com_sseed
to set the random number generator
2018-07-22 15:06:19 +02:00
Holger Vogt 8fbcb16a57 add fourth parameter to cp_getvar(), in functions missing so far 2018-07-22 14:58:25 +02:00
Holger Vogt 09c876550f prevent string overflow by adding the string length
to the cp_getvar parameters. Used only with CP_STRING
2018-07-22 14:57:49 +02:00
Holger Vogt 824ac4fbc9 make functions static or add function prototypes 2018-07-21 23:56:14 +02:00
Holger Vogt d9d47bd823 fix a bug: missing
#ifdef XSPICE
prevents compiling of ngshared
without --enable-xspice in ./configure
2018-06-30 21:19:51 +02:00
Holger Vogt 8324b0f646 prepare ngspice-28 2018-05-19 22:15:41 +02:00
Holger Vogt 710e98a22c Fcn ngGet_Vec_Info(): copy the vector pointer into a static pointer
infovec only if it is derived from event data (checked by a
scale vector with name "step"). Upon next call to fcn
ngGet_Vec_Info() first free the vector pointed to by infovec.

resolve merge conflict
2018-05-19 16:52:42 +02:00
Holger Vogt 8aff70036a Put variable wantevtdata into the right place,
also available for standard executable, to be
modified in sharedspice.c only.
2018-05-19 16:52:08 +02:00
h_vogt 11bafd70ea update to callback functions SendEvtData, SendInitEvtData 2018-05-19 16:46:16 +02:00
h_vogt b5f31ec2b1 version conflict rersolved in sharedspice.c 2018-05-19 16:44:46 +02:00
h_vogt 25a324ba6e add parameter mode to EVTsharedsend_line()
last entry for the dictionary list is NULL
2018-05-19 16:44:27 +02:00
h_vogt 994d190de5 shared_send_dict(char* dictline) to sent the node list 2018-05-19 16:44:02 +02:00
h_vogt 3e52cdd8c1 evtdump.c, prepare data gathering for callbacks similar to sending data via the ancient ipc channel 2018-05-19 16:43:31 +02:00
h_vogt b621875abf sharedspice.h, .c, prepare adding callback functions: new ngSpice_Init_Evt() and function pointers 2018-05-19 16:43:19 +02:00
h_vogt fc42cef878 New functions for XSPICE event node data exported from shared ngspice: ngGet_Evt_NodeInfo(char*) and ngSpice_AllEvtNodes(void) 2018-05-19 16:42:18 +02:00
Holger Vogt 7363532d11 search for user's initialization files has been
optimized away because of an empty if clause.
A simple rewrite firstly asks for .spiceinit, then for spice.rc
2018-05-19 14:41:06 +02:00
h_vogt 3814201d13 Add function read_initialisation_file().
extend search path for .spiceinit, search sequence now is:
current directory, user HOME directory, user USERPROFILE directory
2017-08-12 18:03:54 +02:00
h_vogt 69b235531e sharedspice.c, introduce csh variable "sharedmode"
to reflect whether running as shared library
2017-04-12 21:22:22 +02:00
h_vogt 9f62057973 introduce include file "ngspice/randnumb.h" 2016-08-15 11:30:26 +02:00
rlar d298d5cc2f use memset() instead of deprecated bzero() 2016-07-30 20:58:33 +02:00
h_vogt b14e7cb040 sharedspice.c, remove meory leaks 2016-05-28 16:52:50 +02:00
rlar be3c60badd sharedspice.c, add prototype for `getisrcval()' 2015-12-27 12:03:34 +01:00
h_vogt 8ae0b53b9f sharedspice.c, fix `retval' parameter for `pthread_exit()' 2015-12-27 12:03:29 +01:00
rlar c94d7153fd fix commit, "src/sharedspice.c, add vfprintf to interface for transferring ..." 2015-12-16 21:14:11 +01:00
h_vogt 0b92d8cfe1 src/sharedspice.c, add vfprintf to interface for transferring messages 2015-12-15 22:16:47 +01:00
rlar 33487b7d68 src/sharedspice.c, add ATTRIBUTE_NORETURN to function `shared_exit()' declaration 2015-12-15 22:05:14 +01:00
rlar 917ae030c9 src/sharedspice.c, fix #include style 2015-11-15 15:09:26 +01:00
rlar 8d44da4741 sharedspice.c, disable unused code 2015-01-22 17:50:16 +01:00