Changeset 4798
- Timestamp:
- Mar 19, 2014 9:20:17 PM (11 years ago)
- Location:
- pjproject/trunk/pjsip-apps/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pygui/application.py
r4704 r4798 40 40 import traceback 41 41 42 # You may try to enable pjsua worker thread by setting USE_THREADS below to True *and* 43 # recreate the swig module with adding -threads option to swig (uncomment USE_THREADS 44 # in swig/python/Makefile). In my experiment this would crash Python as reported in: 45 # http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2014-March/017223.html 46 USE_THREADS = False 42 47 43 48 class Application(ttk.Frame): … … 46 51 """ 47 52 def __init__(self): 53 global USE_THREADS 48 54 ttk.Frame.__init__(self, name='application', width=300, height=500) 49 55 self.pack(expand='yes', fill='both') … … 74 80 # Default config 75 81 self.appConfig = settings.AppConfig() 76 self.appConfig.epConfig.uaConfig.threadCnt = 0; 77 self.appConfig.epConfig.uaConfig.mainThreadOnly = True 82 if USE_THREADS: 83 self.appConfig.epConfig.uaConfig.threadCnt = 1 84 self.appConfig.epConfig.uaConfig.mainThreadOnly = False 85 else: 86 self.appConfig.epConfig.uaConfig.threadCnt = 0 87 self.appConfig.epConfig.uaConfig.mainThreadOnly = True 78 88 self.appConfig.epConfig.logConfig.writer = self.logger 79 89 self.appConfig.epConfig.logConfig.filename = "pygui.log" … … 102 112 103 113 def start(self, cfg_file='pygui.js'): 114 global USE_THREADS 104 115 # Load config 105 116 if cfg_file and os.path.exists(cfg_file): 106 117 self.appConfig.loadFile(cfg_file) 107 118 108 self.appConfig.epConfig.uaConfig.threadCnt = 0; 119 if USE_THREADS: 120 self.appConfig.epConfig.uaConfig.threadCnt = 1 121 self.appConfig.epConfig.uaConfig.mainThreadOnly = False 122 else: 123 self.appConfig.epConfig.uaConfig.threadCnt = 0 124 self.appConfig.epConfig.uaConfig.mainThreadOnly = True 125 self.appConfig.epConfig.uaConfig.threadCnt = 0 109 126 self.appConfig.epConfig.uaConfig.mainThreadOnly = True 110 127 self.appConfig.epConfig.logConfig.writer = self.logger … … 137 154 138 155 # Start polling 139 self._onTimer() 156 if not USE_THREADS: 157 self._onTimer() 140 158 141 159 def updateAccount(self, acc): -
pjproject/trunk/pjsip-apps/src/swig/python/Makefile
r4744 r4798 9 9 endif 10 10 11 SWIG_FLAGS += -w312 11 #USE_THREADS = -threads -DSWIG_NO_EXPORT_ITERATOR_METHODS 12 SWIG_FLAGS += -w312 $(USE_THREADS) 12 13 13 14 .PHONY: all install uninstall … … 23 24 24 25 pjsua2_wrap.cpp: ../pjsua2.i ../symbols.i Makefile $(SRCS) 25 swig $(SWIG_FLAGS) -python 26 swig $(SWIG_FLAGS) -python -o pjsua2_wrap.cpp ../pjsua2.i 26 27 27 28 clean distclean realclean:
Note: See TracChangeset
for help on using the changeset viewer.