- Timestamp:
- Dec 5, 2013 3:03:36 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/endpoint.hpp
r4672 r4678 27 27 #include <pjsua2/media.hpp> 28 28 #include <pjsua2/siptypes.hpp> 29 #include <list> 29 30 30 31 /** PJSUA2 API is inside pj namespace */ … … 184 185 */ 185 186 unsigned threadCnt; 187 188 /** 189 * When this flag is non-zero, all callbacks that come from thread 190 * other than main thread will be posted to the main thread and 191 * to be executed by Endpoint::libHandleEvents() function. This 192 * includes the logging callback. Note that this will only work if 193 * threadCnt is set to zero and Endpoint::libHandleEvents() is 194 * performed by main thread. By default, the main thread is set 195 * from the thread that invoke Endpoint::libCreate() 196 * 197 * Default: false 198 */ 199 bool mainThreadOnly; 186 200 187 201 /** … … 635 649 }; 636 650 651 /* This represents posted job */ 652 struct PendingJob 653 { 654 /** Perform the job */ 655 virtual void execute(bool is_pending) = 0; 656 657 /** Virtual destructor */ 658 virtual ~PendingJob() {} 659 }; 660 637 661 ////////////////////////////////////////////////////////////////////////////// 638 662 … … 717 741 * structure, because polling then will be done by these worker threads 718 742 * instead. 743 * 744 * If EpConfig::UaConfig::mainThreadOnly is enabled and this function 745 * is called from the main thread (by default the main thread is thread 746 * that calls libCreate()), this function will also scan and run any 747 * pending jobs in the list. 719 748 * 720 749 * @param msec_timeout Maximum time to wait, in miliseconds. … … 765 794 766 795 /** 796 * Write a log entry. 797 * 798 * @param e The log entry. 799 */ 800 void utilLogWrite(LogEntry &e); 801 802 /** 767 803 * This is a utility function to verify that valid SIP url is given. If the 768 804 * URL is a valid SIP/SIPS scheme, PJ_SUCCESS will be returned. … … 814 850 */ 815 851 void utilTimerCancel(Token prmToken); 852 853 /** 854 * Utility to register a pending job to be executed by main thread. 855 * If EpConfig::UaConfig::mainThreadOnly is false, the job will be 856 * executed immediately. 857 * 858 * @param job The job class. 859 */ 860 void utilAddPendingJob(PendingJob *job); 816 861 817 862 /** … … 1122 1167 { PJ_UNUSED_ARG(prm); } 1123 1168 1124 1125 1169 private: 1126 1170 static Endpoint *instance_; // static instance … … 1129 1173 AudDevManager audioDevMgr; 1130 1174 CodecInfoVector codecInfoList; 1175 1176 /* Pending logging */ 1177 bool mainThreadOnly; 1178 void *mainThread; 1179 unsigned pendingJobSize; 1180 std::list<PendingJob*> pendingJobs; 1181 1182 void performPendingJobs(); 1131 1183 1132 1184 /* Endpoint static callbacks */
Note: See TracChangeset
for help on using the changeset viewer.