Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Bug_1482_Regression / Hello.cpp
blob5a403fb9ee54216e33497df1e290cd2debc5ec04
1 #include "Hello.h"
2 #include "ace/ACE.h"
4 Hello::Hello (CORBA::ORB_ptr orb)
5 : orb_ (CORBA::ORB::_duplicate (orb))
6 , mutex_ ()
7 , latest_prime_ (0)
11 CORBA::ULong
12 Hello::next_prime ()
14 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
15 ace_mon,
16 this->mutex_,
17 this->latest_prime_);
19 if (this->latest_prime_ > 10000)
20 ACE_OS::abort ();
22 for (CORBA::Long ind = 0;
23 ind != 400;
24 ++ind)
26 CORBA::Short bc = 0;
28 while (bc == 0)
30 ++this->latest_prime_;
31 if (ACE::is_prime (this->latest_prime_,
33 this->latest_prime_ / 2) == 0)
34 bc = 1;
38 return this->latest_prime_;