summaryrefslogtreecommitdiff
path: root/ace/Thread.i
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2000-03-22 16:37:49 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2000-03-22 16:37:49 +0000
commit82b90238ff86818269f3aebab6b513d9bc53e57d (patch)
tree751f7bab0fb83824fd60ffd6f0e8ae021e4bf2eb /ace/Thread.i
parentbb56288f76ce4ed463427b10f525fe92b609fe35 (diff)
downloadATCD-82b90238ff86818269f3aebab6b513d9bc53e57d.tar.gz
ChangeLogTag:Wed Mar 22 10:19:47 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'ace/Thread.i')
-rw-r--r--ace/Thread.i35
1 files changed, 18 insertions, 17 deletions
diff --git a/ace/Thread.i b/ace/Thread.i
index 103e348fa77..610b84f1ad0 100644
--- a/ace/Thread.i
+++ b/ace/Thread.i
@@ -160,16 +160,17 @@ ACE_Thread::disablecancel (struct cancel_state *old_state)
{
ACE_TRACE ("ACE_Thread::disablecancel");
int old_cstate = 0;
- int retval;
- if ((retval = ACE_OS::thr_setcancelstate (THR_CANCEL_DISABLE,
- &old_cstate)) == 0)
- if (old_state != 0)
+ int result = ACE_OS::thr_setcancelstate (THR_CANCEL_DISABLE,
+ &old_cstate);
+ if (result == 0 && old_state != 0)
{
- ACE_OS::memset (old_state, 0, sizeof(old_state));
+ ACE_OS::memset (old_state,
+ 0,
+ sizeof (old_state));
old_state->cancelstate = old_cstate;
}
- return retval;
+ return result;
}
ACE_INLINE int
@@ -179,17 +180,17 @@ ACE_Thread::enablecancel (struct cancel_state *old_state,
ACE_TRACE ("ACE_Thread::enablecancel");
int old_cstate = 0;
int old_ctype = 0;
- int retval;
-
- retval = ACE_OS::thr_setcancelstate (THR_CANCEL_ENABLE, &old_cstate);
-
- if (retval != 0)
- return retval;
+ int result;
- retval = ACE_OS::thr_setcanceltype (flag, &old_ctype);
+ result = ACE_OS::thr_setcancelstate (THR_CANCEL_ENABLE,
+ &old_cstate);
+ if (result != 0)
+ return result;
- if (retval != 0)
- return retval;
+ result = ACE_OS::thr_setcanceltype (flag,
+ &old_ctype);
+ if (result != 0)
+ return result;
if (old_state != 0)
{
@@ -210,12 +211,12 @@ ACE_Thread::setcancelstate (struct cancel_state &new_state,
if (new_state.cancelstate != 0
&& ACE_OS::thr_setcancelstate (new_state.cancelstate,
- &old_cstate) == 0)
+ &old_cstate) != 0)
return -1;
if (new_state.canceltype != 0
&& ACE_OS::thr_setcanceltype (new_state.canceltype,
- &old_ctype) == 0)
+ &old_ctype) != 0)
{
int o_cstate;