RPM Package Manager, CVS Repository
/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 20-Sep-2010 19:50:50
Branch: rpm-5_3 Handle: 2010092017505000
Modified files: (Branch: rpm-5_3)
rpm/rpmio rpmruby.c rpmruby.h
Log:
- ruby: sanity.
Summary:
Revision Changes Path
2.12.2.6 +33 -1 rpm/rpmio/rpmruby.c
2.7.2.3 +18 -4 rpm/rpmio/rpmruby.h
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmruby.c
============================================================================
$ cvs diff -u -r2.12.2.5 -r2.12.2.6 rpmruby.c
--- rpm/rpmio/rpmruby.c 19 Sep 2010 21:30:37 -0000 2.12.2.5
+++ rpm/rpmio/rpmruby.c 20 Sep 2010 17:50:50 -0000 2.12.2.6
@@ -34,11 +34,43 @@
/*@unchecked@*/
int _rpmruby_debug = 0;
-#define RUBYDBG(_l) if (_rpmruby_debug) fprintf _l
/*@unchecked@*/ /*@relnull@*/
rpmruby _rpmrubyI = NULL;
+/*==============================================================*/
+/* puts the Ruby coroutine in control */
+void _rpmruby_main_to_ruby(rpmruby ruby)
+{
+ rpmzLog zlog = ruby->zlog;
+
+ yarnRelease(ruby->ruby_coroutine_lock);
+ yarnPossess(ruby->main_coroutine_lock);
+if (_rpmruby_debug < 0) Trace((zlog, "-> %s", __FUNCTION__));
+}
+
+/* puts the main C program in control */
+unsigned long _rpmruby_ruby_to_main(rpmruby ruby, unsigned long self)
+{
+ rpmzLog zlog = ruby->zlog;
+
+ yarnRelease(ruby->main_coroutine_lock);
+ yarnPossess(ruby->ruby_coroutine_lock);
+if (_rpmruby_debug < 0) Trace((zlog, "<- %s", __FUNCTION__));
+ return Qnil;
+}
+
+#ifdef NOTYET
+/* Using _rpmrubyI, puts the main C program in control */
+static VALUE relay_from_ruby_to_main(VALUE self)
+{
+ /* XXX FIXME: _rpmrubyI is global */
+ return _rpmruby_ruby_to_main(_rpmrubyI, self);
+}
+#endif
+
+/*==============================================================*/
+
static void rpmrubyFini(void * _ruby)
/*@globals fileSystem @*/
/*@modifies *_ruby, fileSystem @*/
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmruby.h
============================================================================
$ cvs diff -u -r2.7.2.2 -r2.7.2.3 rpmruby.h
--- rpm/rpmio/rpmruby.h 19 Sep 2010 21:30:39 -0000 2.7.2.2
+++ rpm/rpmio/rpmruby.h 20 Sep 2010 17:50:50 -0000 2.7.2.3
@@ -7,6 +7,8 @@
#include <rpmiotypes.h>
#include <rpmio.h>
+#include <argv.h>
+#include <rpmzlog.h>
#include <yarn.h>
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmruby_s * rpmruby;
@@ -18,19 +20,26 @@
extern rpmruby _rpmrubyI;
#if defined(_RPMRUBY_INTERNAL)
+#define RUBYDBG(_l) if (_rpmruby_debug) fprintf _l
+#define Trace(_x) do { rpmzLogAdd _x; } while (0)
struct rpmruby_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
void * I;
size_t nstack;
void * stack;
- const char * fn;
- yarnThread ruby_coroutine;
+ ARGV_t av;
+ int ac;
+
+ struct timeval start; /*!< starting time of day for tracing */
+/*@refcounted@*/ /*@null@*/
+ rpmzLog zlog; /*!< trace logging */
+
+ unsigned more;
+ yarnThread thread;
yarnLock main_coroutine_lock;
yarnLock ruby_coroutine_lock;
- unsigned ruby_coroutine_finished;
-
unsigned long state;
#if defined(__LCLINT__)
/*@refs@*/
@@ -112,6 +121,11 @@
/*@globals fileSystem, internalState @*/
/*@modifies ruby, *resultp, fileSystem, internalState @*/;
+void _rpmruby_main_to_ruby(rpmruby ruby)
+ /*@*/;
+unsigned long _rpmruby_ruby_to_main(rpmruby ruby, unsigned long _self)
+ /*@*/;
+
#ifdef __cplusplus
}
#endif
@@ .
Received on Mon Sep 20 19:50:51 2010