This is the forked call queue.

ForkedCallQueue.[Ch] should go in support/

Alfredo
Index: support/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.155
diff -u -r1.155 ChangeLog
--- support/ChangeLog	2003/02/25 15:17:53	1.155
+++ support/ChangeLog	2003/02/25 17:59:01
@@ -1,5 +1,9 @@
 2003-02-25  Alfredo Braunstein <[EMAIL PROTECTED]>
 
+	* ForkedCallQueue.[Ch]: added
+
+2003-02-25  Alfredo Braunstein <[EMAIL PROTECTED]>
+
 	* forkedcontr.C (timer): Start the loop afresh if an item is deleted.
 	Emiting the signal can result in an arbitrary change to the list.
 
Index: support/Makefile.am
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/Makefile.am,v
retrieving revision 1.54
diff -u -r1.54 Makefile.am
--- support/Makefile.am	2003/02/08 19:18:01	1.54
+++ support/Makefile.am	2003/02/25 17:59:02
@@ -66,4 +66,6 @@
 	textutils.h \
 	translator.h \
 	types.h \
-	unlink.C
+	unlink.C \
+	ForkedCallQueue.C
+	ForkedCallQueue.h
Index: graphics/GraphicsConverter.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/graphics/GraphicsConverter.C,v
retrieving revision 1.26
diff -u -r1.26 GraphicsConverter.C
--- graphics/GraphicsConverter.C	2003/02/13 16:53:00	1.26
+++ graphics/GraphicsConverter.C	2003/02/25 17:59:04
@@ -17,6 +17,7 @@
 
 #include "support/filetools.h"
 #include "support/forkedcall.h"
+#include "support/ForkedCallQueue.h"
 #include "support/lyxlib.h"
 
 #include <boost/bind.hpp>
@@ -191,21 +192,12 @@
 		return;
 	}
 
-	// Initiate the conversion
-	Forkedcall::SignalTypePtr convert_ptr;
-	convert_ptr.reset(new Forkedcall::SignalType);
-
-	convert_ptr->connect(
-		boost::bind(&Impl::converted, this, _1, _2));
-
-	Forkedcall call;
-	int retval = call.startscript(script_command_, convert_ptr);
-	if (retval > 0) {
-		// Unable to even start the script, so clean-up the mess!
-		converted(0, 1);
-	}
-}
+	Forkedcall::SignalTypePtr 
+		ptr = ForkedCallQueue::get().add(script_command_);
 
+	ptr->connect(boost::bind(&Impl::converted, this, _1, _2));
+
+}
 
 void Converter::Impl::converted(pid_t /* pid */, int retval)
 {

Reply via email to