c_inp_stream and friends are thread private!

This commit is contained in:
Vítor Santos Costa
2010-07-27 17:28:58 +01:00
parent 4c9d74c2e7
commit 18d77309a6
9 changed files with 25 additions and 8 deletions

View File

@@ -21,6 +21,10 @@
#define Yap_c_input_stream WL->c_input_stream
#define Yap_c_output_stream WL->c_output_stream
#define Yap_c_error_stream WL->c_error_stream
#define OldASP WL->rinfo.old_ASP
#define OldLCL0 WL->rinfo.old_LCL0

View File

@@ -22,6 +22,10 @@
typedef struct worker_local {
int c_input_stream;
int c_output_stream;
int c_error_stream;
restoreinfo rinfo;

View File

@@ -22,6 +22,10 @@
static void InitWorker(int wid) {
FOREIGN_WL(wid)->c_input_stream = 0;
FOREIGN_WL(wid)->c_output_stream = 1;
FOREIGN_WL(wid)->c_error_stream = 2;
FOREIGN_WL(wid)->rinfo.old_ASP = NULL;
FOREIGN_WL(wid)->rinfo.old_LCL0 = NULL;
FOREIGN_WL(wid)->rinfo.old_TR = NULL;

View File

@@ -54,6 +54,10 @@ static void RestoreWorker(int wid) {

View File

@@ -322,11 +322,6 @@ Term STD_PROTO(Yap_WStringToList,(wchar_t *));
Term STD_PROTO(Yap_WStringToListOfAtoms,(wchar_t *));
Atom STD_PROTO(Yap_LookupWideAtom,(wchar_t *));
extern int
Yap_c_input_stream,
Yap_c_output_stream,
Yap_c_error_stream;
#define YAP_INPUT_STREAM 0x01
#define YAP_OUTPUT_STREAM 0x02
#define YAP_APPEND_STREAM 0x04