[omniORB] Hello and Native NT Thread problem.

Saroj Mahapatra saroj@Bear.COM
Mon, 20 Apr 1998 13:06:18 -0400


>

[Snipped]

Hi,

I just wanted to add that my previous posting has two small bugs in the second
and third solution :

check_point argument to Thr::Thread constructor in second solution and to
ThrThread  constructor in the third
solution should not be local variables. It should be member variable in
OmniNamesLog class.

2nd solution:

class OmniNamesLog
{
public:
  OmniNamesLog()
    : check_point(this, do_check_point) {
    // do_check_point member function (non-static) will
    // be called by the new thread.
    Thr::Thread timer_thr(&check_point_, Thr::detached);
  }
private:
  ThrAction<OmniNamesLog> check_point_;
  ...
};

3rd solution
---------

class OmniNamesLog
{
public:
  OmniNamesLog()
    : check_point_(this, do_check_point)
  {
    ThrThread<CheckPoint> timer_thr(&check_point_, Thr::Detached);
  }
private:
  typedef ThrAction<OmniNamesLog> CheckPoint;
  CheckPoint check_point_;
  ...
}


Probably, Thread::Thread(Action*, Thr::Detached) can take an additonal boolean
argument. A true value will mean
delete the action after the thread is run.

- Saroj Mahapatra





***********************************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, offer or
agreement or any information about any transaction, customer account or account
activity contained in this communication.
***********************************************************************************