diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-07-30 07:27:13 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-07-30 07:27:13 +0000 |
commit | 1146f9f8755d161024af119837d80fa40243450f (patch) | |
tree | 0bc81a67d7005a3047dd16e1eb226f493f1d5885 /ace/Synch_T.cpp | |
parent | dc02299bc92b300d3552f69966eee8d3a4e62d9a (diff) | |
download | ATCD-1146f9f8755d161024af119837d80fa40243450f.tar.gz |
changed how constness gets cast away in ts_init.
Diffstat (limited to 'ace/Synch_T.cpp')
-rw-r--r-- | ace/Synch_T.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp index 959acb8fc10..dfabd6b5f7a 100644 --- a/ace/Synch_T.cpp +++ b/ace/Synch_T.cpp @@ -270,7 +270,7 @@ ACE_TSS<TYPE>::ts_init (void) const // once! if (this->once_ == 0) { - if (ACE_Thread::keycreate (&this->key_, + if (ACE_Thread::keycreate (ACE_const_cast (ACE_thread_key_t *, &this->key_), #if defined (ACE_HAS_THR_C_DEST) &ACE_TSS_C_cleanup, #else @@ -282,9 +282,7 @@ ACE_TSS<TYPE>::ts_init (void) const { // This *must* come last to avoid race conditions! Note that // we need to "cast away const..." - // BTW, if this code doesn't compile, please try the following instead. - // *(int *) &this->once_ = 1; - ACE_const_cast (int, this->once_) = 1; + * ACE_const_cast (int*, &this->once_) = 1; return 0; } } @@ -414,7 +412,7 @@ ACE_TSS<TYPE>::ts_get (void) const #if defined (ACE_HAS_THR_C_DEST) // Return the underlying ts object. - return (TYPE *) tss_adapter->ts_obj_; + return (TYPE *) tss_adapter->ts_obj_; #else return ts_obj; #endif /* ACE_HAS_THR_C_DEST */ |