8 #include "ace/Auto_Ptr.h"
10 class Server_Task
: public ACE_Task_Base
14 Server_Task (const std::string
& args
)
19 this->force_shutdown ();
24 bool initializer
= false;
26 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX
, ace_mon
, this->mutex_
, -1);
27 if (server_
.get() == 0) {
28 ACE_ARGV
my_args (args_
.c_str());
30 // Initialize Server ORB in new thread
31 ACE_auto_ptr_reset (server_
, new Server (my_args
.argc(), my_args
.argv()));
32 ACE_ASSERT (server_
.get() != 0);
39 this->force_shutdown (); // servant thread is responsible for shutdown
50 if (server_
.get() != 0) {
51 return server_
->init_
;
57 void force_shutdown ()
59 if (server_
.get() != 0) {
66 std::auto_ptr
<Server
> server_
;
67 TAO_SYNCH_MUTEX mutex_
;
70 #endif //_SERVER_TASK_