Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_1482_Regression / Hello.cpp
blob33e7e166cef17ff5abc30da616121425ab79e07a
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 (void)
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_;