12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

使 用 服 务 激 活 方 法obj->_release();}};// 多 线 程 回 收 器 , 每 30s// 销 毁 所 有 已 激 活 的 对 象 。class DBObjectImplReaper :public VISThread {public:// 回 收 器 方 法virtual void start() {run();}virtual CORBA::Boolean startTimer() {vsleep(30);return 1;virtual void begin() {while (startTimer()) {doOneReaping();}}protected:virtual void doOneReaping() {VISMutex_var lock(_implMtx);for (CORBA::ULong i=0; i < _impls.length(); i++) {// 将 nil 分 配 给 各 元 素 的 操 作 将 被 释 放// 存 储 在 _var 中 的 引 用DBObject_var obj = DBObject::_duplicate(_impls[i-1];_impls[i] = DBObject::_nil();CORBA::BOA_var boa = obj->_boa();boa->deactivate_obj(obj);}_impls.length(0);}};使 用 对 象 激 活 器 31-9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!