diff options
author | Josh Blum | 2013-05-11 14:19:06 -0700 |
---|---|---|
committer | Josh Blum | 2013-05-11 14:19:06 -0700 |
commit | 89ef118890bcd5df8441be95dfe70a90f39d3bd7 (patch) | |
tree | 5dca5a0ae58f12cb28fe429079f2570d338d08ca /gnuradio-core/src | |
parent | 7c193faac2c3737924a67c1e9b87f50e54724dd9 (diff) | |
download | gnuradio-89ef118890bcd5df8441be95dfe70a90f39d3bd7.tar.gz gnuradio-89ef118890bcd5df8441be95dfe70a90f39d3bd7.tar.bz2 gnuradio-89ef118890bcd5df8441be95dfe70a90f39d3bd7.zip |
gras: backwards compat rt prio stuff
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r-- | gnuradio-core/src/python/gnuradio/gr/__init__.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/__init__.py b/gnuradio-core/src/python/gnuradio/gr/__init__.py index 49d33ebf0..8e4a435ae 100644 --- a/gnuradio-core/src/python/gnuradio/gr/__init__.py +++ b/gnuradio-core/src/python/gnuradio/gr/__init__.py @@ -33,11 +33,27 @@ from tag_utils import tag_to_python, tag_to_pmt import gras -RT_OK = 1 +RT_OK = 0 +RT_NOT_IMPLEMENTED = 1 +RT_NO_PRIVS = 2 +RT_OTHER_ERROR = 3 + def enable_realtime_scheduling(): - #will have this in a theron update - return 0 + """ + This call is for backward compat purposes. + See gras/thread_pool.hpp for greater options. + """ + + #create a new thread pool with thread priority set > 0 + #any prio greater than 0 means realtime scheduling + config = gras.ThreadPoolConfig() + config.thread_priority = 0.5 + tp = gras.ThreadPool(config) + tp.set_active() + + #TODO we need a real check for OK + return RT_OK class top_block(gras.TopBlock): def __init__(self, name="Top"): |