(file) Return to AsyncOpNode.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

 1 mike  1.2 //%//////////////////////////////////////////////////////////////////////////
 2           //
 3           // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
 4           //
 5           // Permission is hereby granted, free of charge, to any person obtaining a copy
 6           // of this software and associated documentation files (the "Software"), to 
 7           // deal in the Software without restriction, including without limitation the 
 8           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
 9           // sell copies of the Software, and to permit persons to whom the Software is
10           // furnished to do so, subject to the following conditions:
11           // 
12           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
13           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
14           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
16           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
17           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
18           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20           //
21           //==============================================================================
22 mike  1.2 //
23           // Author: Mike Day (mdday@us.ibm.com)
24           //
25           // Modified By: 
26           //
27           //%/////////////////////////////////////////////////////////////////////////////
28           
29           #include <Pegasus/Common/AsyncOpNode.h>
30           
31           PEGASUS_NAMESPACE_BEGIN
32              
33           AsyncOpNode::AsyncOpNode(void) 
34              : _client_sem(1), _mut(), _request(0), _response(0), 
35                _state(0), _flags(0), _total_ops(0), _completed_ops(0), 
36                _parent(0), _children(true)
37           {
38 mday  1.4    gettimeofday(&_start, NULL);
39 mike  1.2    memset(&_lifetime, 0x00, sizeof(struct timeval));
40              memset(&_updated, 0x00, sizeof(struct timeval));
41              memset(&_timeout_interval, 0xff, sizeof(struct timeval));
42           }
43           
44           AsyncOpNode::~AsyncOpNode(void)
45           {
46              delete _request;
47 mday  1.3    _response.empty_list();
48 mike  1.2 }
49           
50           
51           void AsyncOpNode::_reset(unlocked_dq<AsyncOpNode> *dst_q)
52           {
53              AsyncOpNode *child = _children.remove_first();
54              while( child != 0 )
55              {
56                 child->_reset(dst_q);
57                 child = _children.remove_first();
58              }
59           
60              _parent = 0;
61              delete _request;
62 mday  1.5    _request = 0;
63 mday  1.3    _response.empty_list();
64 mike  1.2    _operation_list.reset();
65              _state = 0;
66              _flags = 0;
67              _total_ops = 0;
68              _completed_ops = 0;
69              dst_q->insert_first(this);
70 mday  1.5    while ( _client_sem.count() )
71                 _client_sem.wait();
72              PEGASUS_ASSERT( _client_sem.count() == 0 );
73              
74 mike  1.2    return;
75           }
76           
77           PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2