diff options
author | Eric Blossom | 2010-11-20 16:30:43 -0800 |
---|---|---|
committer | Eric Blossom | 2010-11-20 16:30:43 -0800 |
commit | 6551f537ed235bbb0ddfadb50744ea3b3fcbc2e6 (patch) | |
tree | b75ba0a18309649f2b64f2b1f7325373ddf2bef2 /gnuradio-core/src/lib/runtime | |
parent | 37a1e931c11f2ba0bdd8ef9ff07c6710e83c6139 (diff) | |
download | gnuradio-6551f537ed235bbb0ddfadb50744ea3b3fcbc2e6.tar.gz gnuradio-6551f537ed235bbb0ddfadb50744ea3b3fcbc2e6.tar.bz2 gnuradio-6551f537ed235bbb0ddfadb50744ea3b3fcbc2e6.zip |
Add guile shim to gr_top_block::wait that exits guile mode before blocking.
Diffstat (limited to 'gnuradio-core/src/lib/runtime')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_top_block.i | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index f18d8890b..90fa18b94 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008 Free Software Foundation, Inc. + * Copyright 2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -42,8 +42,8 @@ public: void start() throw (std::runtime_error); void stop(); - void wait(); - void run() throw (std::runtime_error); + //void wait(); + //void run() throw (std::runtime_error); void lock(); void unlock() throw (std::runtime_error); void dump(); @@ -71,6 +71,33 @@ void top_block_wait_unlocked(gr_top_block_sptr r) throw (std::runtime_error) #endif -#ifdef SWIG_GUILE -#warning "gr_top_block.i: top_block_run_unlocked needs to be implemented!" +#ifdef SWIGGUILE + +%{ + struct tb_arg_holder { + gr_top_block_sptr tb; + }; + + static void * + tb_wait_shim(void *arg) + { + tb_arg_holder *a = (tb_arg_holder *)arg; + a->tb->wait(); + return 0; + } + +%} + +%inline %{ + + static void + top_block_wait_unlocked(gr_top_block_sptr r) throw (std::runtime_error) + { + tb_arg_holder a; + a.tb = r; + scm_without_guile(tb_wait_shim, (void *) &a); + } + +%} + #endif |