summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/python
diff options
context:
space:
mode:
authorJosh Blum2013-05-11 16:19:26 -0700
committerJosh Blum2013-05-11 16:19:26 -0700
commit2c0627d07360e31bb25ac334d349eb52e27086f0 (patch)
treec19bcde7e4402950e8b64b0b7f9c67937c57ea3c /gnuradio-core/src/python
parent89ef118890bcd5df8441be95dfe70a90f39d3bd7 (diff)
downloadgnuradio-2c0627d07360e31bb25ac334d349eb52e27086f0.tar.gz
gnuradio-2c0627d07360e31bb25ac334d349eb52e27086f0.tar.bz2
gnuradio-2c0627d07360e31bb25ac334d349eb52e27086f0.zip
gras: make use of test_thread_priority api call
Diffstat (limited to 'gnuradio-core/src/python')
-rw-r--r--gnuradio-core/src/python/gnuradio/gr/__init__.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/__init__.py b/gnuradio-core/src/python/gnuradio/gr/__init__.py
index 8e4a435ae..ee96f0182 100644
--- a/gnuradio-core/src/python/gnuradio/gr/__init__.py
+++ b/gnuradio-core/src/python/gnuradio/gr/__init__.py
@@ -45,14 +45,19 @@ def enable_realtime_scheduling():
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
+ prio_value = 0.5
+
+ #test that prio
+ if not gras.ThreadPool.test_thread_priority(prio_value):
+ return RT_NO_PRIVS
+
+ #create a new thread pool with thread priority set
config = gras.ThreadPoolConfig()
- config.thread_priority = 0.5
+ config.thread_priority = prio_value
tp = gras.ThreadPool(config)
tp.set_active()
- #TODO we need a real check for OK
return RT_OK
class top_block(gras.TopBlock):